Hello, I did searched everywhere about this with no hope if my file like this: $MyVar = "TEXT1"; echo $MyVar; $MyVar = "TEXT2"; PHP: I want the output to be: TEXT2 not TEXT1 In brief I want to call the variable before it get called Is there any way to do this?? Thanks
The PHP interpreter parses code from top to bottom. You can't output a stream of a variable without first defining it. Why would you want to, anyway?
this is procedural, keep in mind that in procedural method its from left to right, top to bottom. use switch condition, or put in function better yet in a class