Ok now i have another problem i want to send one or more variable from one function to another like this:
class test{
var $text2;
function text1($text1){ // This will catch "This is text" from $text variable.
$text1 = $this -> text2; // Giving $text1 value to $text2
return $this -> text2; // Now here is the trouble i think, i want to send the variable to the next function that is text2(). How do i do that?
}
function text2($text2){ // Here is the place that says undefined variable i want the variable $text2 from function text1() to be called here.
echo $text2; // Now the variable $text2 should echo "This is text".
}
}
$test = new test();
$text1 = "This is text"; // Assigning value to the variable.
$test -> text1($text1); // Passing the variable as parameter in the function text1().
echo $test -> text2($text2); // Trying to display the value of $text2 that is "This is text".