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; ?> Link to comment https://forums.phpfreaks.com/topic/217962-how-complicated-can-this-be/ 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. Link to comment https://forums.phpfreaks.com/topic/217962-how-complicated-can-this-be/#findComment-1131167 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.. Link to comment https://forums.phpfreaks.com/topic/217962-how-complicated-can-this-be/#findComment-1131170 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. Link to comment https://forums.phpfreaks.com/topic/217962-how-complicated-can-this-be/#findComment-1131173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.