You are here: Re: [PHP] resetting arrays « PHP « IT news, forums, messages
Re: [PHP] resetting arrays

Posted by Richard Davey on 10/13/04 11:19

Hello,

Tuesday, June 21, 2005, 1:33:55 PM, you wrote:

IG> I have an array- for example...
IG> What happens, say if I delete [3] => Purple? I get...
IG> But what if I want to reset the numbers? Like...

<?php
$array = array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd', 4 => 'e');
print_r($array);

unset($array[3]);
print_r($array);

sort($array);
print_r($array);
?>

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация