I have a controller that has the next functions:
class controller {
function __construct(){
}
function myfunction(){
//here is my variable
$variable="hello"
}
function myotherfunction(){
//in this function I need to get the value $variable
$variable2=$variable
}
}
I thanks for your answers. How can I pass variables of a function to other function in a controller of codeigniter?
Or you can set $variable as an attribute in you class;
This way variable will be available to all functions/methods in your controller class. Think OOP not procedural.