Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: [PHP5] How I can change an array elements

Started 1 month, 2 weeks ago by onetolearnphp
hi... I have registered new to forum,therefore I dont know rules of the message writing for the time being. my question which is so... for instance; apple,orange,1,2,red,yellow ...and so on how I can change this elements,that is, with helping code ; "1" number can be changed. this data is register in field in my database,consequently this; ...
Site: Dev Shed Forums - Open Source web development  Dev Shed Forums - Open Source web development - site profile
Forum: PHP Development  PHP Development - forum profile
Total authors: 5 authors
Total thread posts: 11 posts
Thread activity: no new posts during last week
Domain info for: devshed.com

Other posts in this thread:

Winters replied 1 month, 2 weeks ago
Welcome to DevShed, onetolearnphp. Please read the sticky posts at the top of the forum. PHP Code: Original - PHP Code $myArray = array('apple','orange',1,2,'red','yellow'); $myArr ay[2] = 7;...

onetolearnphp replied 1 month, 2 weeks ago
thanks winters for your message. PHP Code: <? $myArray = array( 'apple' , 'orange' , 1 , 2 , 'red' , 'yellow' ); $myArray [ 2 ] = 7 ; for ( $i = 0 ; $i <= count ( $myArray ); $i ++) { echo "$myArray[$i]<br>" ; ?> I can't work this code because ...

onetolearnphp replied 1 month, 2 weeks ago
is there one to help me ? please, I have to solve this

Mark Baker replied 1 month, 2 weeks ago
Close the for loop PHP Code: <?php $myArray = array( 'apple' , 'orange' , 1 , 2 , 'red' , 'yellow' ); $myArray [ 2 ] = 7 ; for ( $i = 0 ; $i <= count ( $myArray ); $i ++) { echo "$myArray[$i]<br>" ; } ?>

onetolearnphp replied 1 month, 2 weeks ago
thanks mark berker. I had forget that tag has been closed.

ManiacDan replied 1 month, 2 weeks ago
Also read Mark's signature. You are one of the people it is talking about. You could have solved your own problem by turning on error_reporting and seeing the error for yourself. As for the response time you're getting, please remember that if you have an emergency, we don't care. We volunteer our time to help people for no tangible reward. Don't post things like "is there one ...

onetolearnphp replied 1 month, 2 weeks ago
Quote: Originally Posted by ManiacDan Also read Mark's signature. You are one of the people it is talking about. You could have solved your own problem by turning on error_reporting and seeing the error for yourself. As for the response time you're getting, please remember that if you have an emergency, we don't care. We volunteer our time to help people for no ...

ManiacDan replied 1 month, 2 weeks ago
Quote: therefore I must use php-designer No, you need to simply put this at the top of your page: PHP Code: error_reporting ( E_ALL ); ini_set ( 'display_errors' , 1 ); That will show you the error, which in this particular instance would have been "PARSE ERROR: Unexpected $end" By googling ...

onetolearnphp replied 1 month, 2 weeks ago
okey..I understood you maniacdan...I will use that code. thanks everybody over...

E-Oreo replied 1 month, 2 weeks ago
Actually that code will not show parse errors in this case, you need to modify php.ini to enable it.

 

Top contributing authors

Name
Posts
onetolearnphp
6
user's latest post:
[PHP5] How I can change an array...
Published (2009-11-05 13:31:00)
okey..I understood you maniacdan...I will use that code. thanks everybody over...
ManiacDan
2
user's latest post:
[PHP5] How I can change an array...
Published (2009-11-05 12:05:00)
Quote: therefore I must use php-designer No, you need to simply put this at the top of your page: PHP Code: &nbsp;error_reporting ( E_ALL ); ini_set ( 'display_errors' ,&nbsp; 1 );&nbsp; That will show you the error, which in this particular instance would have been &quot;PARSE ERROR: Unexpected $end&quot; By googling that error, you would have found out that it means you didn't close all your curly braces....
Winters
1
user's latest post:
[PHP5] How I can change an array...
Published (2009-11-05 03:49:00)
Welcome to DevShed, onetolearnphp. Please read the sticky posts at the top of the forum. PHP Code: Original - PHP Code $myArray = array('apple','orange',1,2,'red','yellow'); $myArray[2] = 7; $myArray = array &#40; 'apple' , 'orange' , 1 , 2 , 'red' , 'yellow' &#41; ; $myArray &#91; 2 &#93; = 7 ;
Mark Baker
1
user's latest post:
[PHP5] How I can change an array...
Published (2009-11-05 07:28:00)
Close the for loop PHP Code: &lt;?php &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$myArray&nbsp; =&nbsp;array( 'apple' , 'orange' , 1 , 2 , 'red' , 'yellow' );&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $myArray &#91; 2 ]&nbsp;=&nbsp; 7 ;&nbsp;&nbsp; for&nbsp;( $i = 0 ;&nbsp; $i...
E-Oreo
1
user's latest post:
[PHP5] How I can change an array...
Published (2009-11-05 19:01:00)
Actually that code will not show parse errors in this case, you need to modify php.ini to enable it.

Related threads on "Dev Shed Forums - Open Source web development":

Related threads on other sites:

Thread profile page for "[PHP5] How I can change an array elements" on http://www.devshed.com. This report page is a snippet summary view from a single thread "[PHP5] How I can change an array elements", located on the Message Board at http://www.devshed.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity