|
Posted by Darrell on 12/02/07 01:13
I am trying to write a function but am stopped at square one.
This snippet
<?php
error_reporting(E_ALL);
$Buf = file("bsshort2.txt");
print_r ($Buf);
$aKeys = array_keys($Buf);
print_r ($aKeys);
?>
prints out the file with all of the keys and then prints all of the keys as
expected.
This version
<?php
error_reporting(E_ALL);
$Buf = file("bsshort2.txt");
print_r ($Buf);
$aKeys = array_keys($Buf,("chuck"));
print_r ($aKeys);
?>
prints out the file with all of the keys and then prints Array ( )
This is part of the array that is printed
[9] => Beautiful night already 68, great sleeping weather.
[10] => chuck [11] =>
and this is from the file that is being read
I don't want anybody dying on my watch PEROID. I just don't like LTs.
hollering at me,GRIN<P>
Beautiful night already 68, great sleeping weather.<P>
chuck
<HR>
I would expect to see
Array ( [11] => 11)
What I really want to search for is <HR> but originally thought I was
having trouble searching for <HR> so I tried "chuck".
Where am I going wrong?
Navigation:
[Reply to this message]
|