You are here: Re: array help « All PHP « IT news, forums, messages
Re: array help

Posted by J.O. Aho on 12/04/07 05:34

Darrell wrote:

> I wrote that snippet just to see what the output was from array_keys because
> nothing was working as expected.
> What I was aiming for is an array with all of the keys for <HR> in a text
> file
> in order to trim the file to the last X number of occurrences of <HR>.
> Darrell

This should do the thing you thought about:
$Buf = file("bsshort2.txt");
foreach($Buf AS $key => $value) {
if(!(stristr($value, '<HR>') === FALSE)) {
$hrkeys[]=$key;
}
}


--

//Aho

 

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

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