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. 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 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. 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'; 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 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
Archived
This topic is now archived and is closed to further replies.