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] Array Help [PHP]
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="academic" data-source="post: 228631" data-attributes="member: 9254"><p>I'm not sure if anyone has touched on your original array. However, you mentioned you didn't understand why they were always being changed. Your original followed, similar to this.</p><p></p><p>[PHP]</p><p>$errors = array();</p><p>$errors["username"] = "Username is to long.";</p><p>$errors["username"] = "Username is taken.";</p><p>[/PHP]</p><p></p><p>When you printed it, you were only getting the one error in the "username" key. This is because you were overwriting them each time you repeated the above code and not appending it.</p></blockquote><p></p>
[QUOTE="academic, post: 228631, member: 9254"] I'm not sure if anyone has touched on your original array. However, you mentioned you didn't understand why they were always being changed. Your original followed, similar to this. [PHP] $errors = array(); $errors["username"] = "Username is to long."; $errors["username"] = "Username is taken."; [/PHP] When you printed it, you were only getting the one error in the "username" key. This is because you were overwriting them each time you repeated the above code and not appending it. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP] Array Help [PHP]
Top