View Single Post
  #1 (permalink)  
Old Mar 11th, 2008, 17:50
Jack Franklin's Avatar
Jack Franklin Jack Franklin is offline
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,310
Blog Entries: 8
Thanks: 10
Thanked 5 Times in 5 Posts
Using an actual variable in function params?

Hi,

In a function, when you have parameters, you would usually just do:
functionname(param, example)

But I want to make it so the user, when referencing the function, enters a variable name. For example, when my function is called, it should look like:
function($variable).

How do I do this? If I created the function would it be:
PHP: Select all

function test($variable) {
echo 
$variable;

In that case would it actually display the variable name (INC the $)

Cheers!

Jack
__________________
Resources Administrator


Reply With Quote