Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP Total of Var & Constant
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Damien" data-source="post: 472834" data-attributes="member: 72299"><p>[CODE]$shirts_total = ($shirts += 'SHIRT_PRICE')[/CODE]</p><p>Should be:</p><p>[CODE]$shirts_total = ($shirts += SHIRT_PRICE)[/CODE]</p><p></p><p>By adding the single quotes you're not returning the value from the constant, you're creating a string with the same name.</p></blockquote><p></p>
[QUOTE="Damien, post: 472834, member: 72299"] [CODE]$shirts_total = ($shirts += 'SHIRT_PRICE')[/CODE] Should be: [CODE]$shirts_total = ($shirts += SHIRT_PRICE)[/CODE] By adding the single quotes you're not returning the value from the constant, you're creating a string with the same name. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP Total of Var & Constant
Top