CodeIgniter Forums

Full Version: variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i need to used a variable for two functions . 

one function needs to assign data to the variable and next function needs to read that variable. how can I do this?
Use the equal sign.

$myvar = "Basic php knowledge".
This will set the value of the variable.

To read the value, you can do this:
$myvar2 = $myvar
In php, echo $myvar2; will output the value.