tags:

views:

37

answers:

1
$haystack = 'I am a haystack. Hear me rawr.';
$pos = strlen($haystack);
$nlen = 1;

$needle = array('.', '. ');

print_r(in_array(substr($haystack, $pos, $nlen), $needle, true));

I am having trouble figuring out why this is failing. I am trying to see if an array of needles matches the result that substr chooses from the haystack? How can I return that value as boolean?

+2  A: 
Sarfraz