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
Beautiful night already 68, great sleeping weather.
chuck
I would expect to see
Array ( [10] => 10)
What I really want to search for is
but originally thought I was
having trouble searching for
so I tried “chuck”.
Where am I going wrong?