Re: Recount array
| From: | Oliver Heinisch | Date: | Wed, 12 Jul 2000 19:38:56 +0000 |
| Subject: | Re: Recount array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6249@lists.php.net to get a copy of this message | ||
At 17:43 11.07.00 -0400, you wrote:
I just want to thank every one on this list who has helped so far. It's really appreciated. Now I have another problem to work through. I have a text file that stores an array. The array has elements added and subtracted. Below is a sample of the text file. How can I "recount" the array to be 0, 1, 2 ? <? $news = array ( "0" => array("date"=>"7/11/2000", "author"=>"Jason Bryner", "next"=>"add") ,"2" => array("date"=>"7/13/2000", "author"=>"Jason Bryner", "next"=>"add") ,"3" => array("date"=>"7/10/2000", "author"=>"Jason Bryner", "next"=>"add") ) ?> Hope I understood what you mean, changing the position of sentences in the array new?so $new_news[3] = $news[0]; $new_news[2] = $news[47];... for($x=0; $x < sizeof($new_news) ; $x++) {
$news[$x] = $new_news[$x];} done! g´s Oliver