BRADERY Posted November 6, 2010 Share Posted November 6, 2010 <?php echo $myname; $myname = "Bradery"; ?> That does not work.. is there any way to get it to work without doing this <?php $myname = "Bradery"; echo $myname; ?> Quote Link to comment Share on other sites More sharing options...
christophermichael Posted November 6, 2010 Share Posted November 6, 2010 In the first snippet you are echoing a variable that has no value. It will echo to the browser exactly what you tell it to. And in that case you are telling it to echo nothing. In the second snippet you've assigned a value to the variable before you call it. Hopefully this is along the lines of what you were asking. Not positive because I'm not sure why you'd prefer it the first way. Quote Link to comment Share on other sites More sharing options...
BRADERY Posted November 6, 2010 Author Share Posted November 6, 2010 well because in a script I have the curl session is at the bottom and the variable is defined at the bottom and I need to echo it above where it is defined.. there is no way to redefine it above where I need to echo it out.. Quote Link to comment Share on other sites More sharing options...
George Botley Posted November 6, 2010 Share Posted November 6, 2010 Maybe you could add the script in a loop, running the CURL, then returning with its response and then printing out the value on the second loop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.