peterhuynh Posted February 16, 2015 Share Posted February 16, 2015 I'm looking at this: $message = “{$nonce}{$token}{$path}0.1buy965.45”; Can someone tell me what the syntax means. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/294637-variable-assignment-curly-braces-inside-question-marks/ Share on other sites More sharing options...
Psycho Posted February 16, 2015 Share Posted February 16, 2015 (edited) Take a look at this page of the manual: http://php.net/manual/en/language.types.string.php#language.types.string.parsing Specifically, look at the complex method. Edited February 16, 2015 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/294637-variable-assignment-curly-braces-inside-question-marks/#findComment-1505781 Share on other sites More sharing options...
NotionCommotion Posted February 16, 2015 Share Posted February 16, 2015 Agree with Psycho. By the way, each does the same thing: $message = “{$nonce}{$token}{$path}0.1buy965.45”; $message = $nonce.$token.$path."0.1buy965.45”; $message = $nonce.$token.$path.'0.1buy965.45'; Quote Link to comment https://forums.phpfreaks.com/topic/294637-variable-assignment-curly-braces-inside-question-marks/#findComment-1505798 Share on other sites More sharing options...
Barand Posted February 16, 2015 Share Posted February 16, 2015 or $message = "$nonce$token{$path}0.1buy965.45"; $path requires the {..} to prevent it being interpreted as $path0 which would be a valid variable name Quote Link to comment https://forums.phpfreaks.com/topic/294637-variable-assignment-curly-braces-inside-question-marks/#findComment-1505829 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.