daboymac Posted October 14, 2007 Share Posted October 14, 2007 in other languages they are used for a body of code....but i came across this line echo "<option value = '{$row['Mascot']}'>"; what does it mean? Quote Link to comment https://forums.phpfreaks.com/topic/73220-waht-do-these-mean-in-php/ Share on other sites More sharing options...
wildteen88 Posted October 14, 2007 Share Posted October 14, 2007 These are used when echo'ing an array within a string. Without those braces PHP will get confused. You can add these into code to help PHP out. Quote Link to comment https://forums.phpfreaks.com/topic/73220-waht-do-these-mean-in-php/#findComment-369435 Share on other sites More sharing options...
kratsg Posted October 14, 2007 Share Posted October 14, 2007 They have multiple meanings. This is true: These are used when echo'ing an array within a string. Without those braces PHP will get confused. You can add these into code to help PHP out. PHP.net includes a description of the difference between interpreting 'Mascot' as a string, a value, or a literal (diff analysis). It also is used in RegExp to define a range of values: $pattern = '/[0-9]{1,2}/' Where that means that two numbers from 0 - 9 show up at least once, and no more than two times. {1,2} = {min,max} Quote Link to comment https://forums.phpfreaks.com/topic/73220-waht-do-these-mean-in-php/#findComment-369438 Share on other sites More sharing options...
daboymac Posted October 18, 2007 Author Share Posted October 18, 2007 oh...ok. I get it now...I havent delt much with strings yet Quote Link to comment https://forums.phpfreaks.com/topic/73220-waht-do-these-mean-in-php/#findComment-372412 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.