On Tue, Mar 15, 2011 at 17:34, Jack <[email protected]> wrote:
> Hello All,
>
>
>
> I got some help on this yesterday, but somehow it's not consistant
>
>
>
> <?
For compatibility, you shouldn't use short_open_tags.
> $results = "3434approd34";
Here you're defining the variable as a string.
> if(strpos($results['response'], 'APPROVED') !== false) {
Here you're trying to access it as an array, which it's not, so
the 'response' key doesn't exist. In addition, you're looking for
UPPER-CASE, whereas that's not the case in your example variable.
Finally, you're checking to make sure that the string IS INDEED found,
but then printing that it was declined (!== false). Instead, you may
want:
<?php
$results['response'] = '3434approd34';
if (stripos($results['response'],'APPROVED') !== false) {
// It's been found
} else {
// Oh, crap.
}
?>
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php