ChenXiu Posted August 15, 2021 Share Posted August 15, 2021 When a variable hasn't happened yet, what's the best way? To use a function? To use ob_start()? Or something else? if( $condition == true ){ $instruction = ' hello do this. '; } else { $instruction = " $variable_set_later "; } //code //code //now we set that variable $variable_set_later = 'hello do something else'; // // echo $instruction; Quote Link to comment https://forums.phpfreaks.com/topic/313554-php-echo-variables-that-havent-happened-yet/ Share on other sites More sharing options...
Solution ChenXiu Posted August 15, 2021 Author Solution Share Posted August 15, 2021 Nevermind. I figured it out."sprintf()" Quote Link to comment https://forums.phpfreaks.com/topic/313554-php-echo-variables-that-havent-happened-yet/#findComment-1589131 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.