Forum Moderators: coopster

Message Too Old, No Replies

PHP Array not working

         

Aleco

11:42 pm on Jun 24, 2009 (gmt 0)

10+ Year Member



<snip>
^PHP Code

Explanation inside the PHP code on what I'm having trouble with. Gets a list of names from a text file like this:

Bob
Joe
John

Puts it in an array then I would like to check if it's in the array, as you can see it doesn't work (in_array).

[edited by: dreamcatcher at 8:05 am (utc) on June 25, 2009]
[edit reason] No personal urls, thanks. [/edit]

coopster

10:30 am on Jun 25, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Aleco.

Have you dumped the array first to make sure it contains the list you expect?

<?php 
print '<pre>';
print_r($myArray);
print '</pre>';
exit;
?>

newb2seo

3:17 pm on Jun 25, 2009 (gmt 0)

10+ Year Member



post your code please.