----- Original Message -----
From: "AJDIN BRANDIC" <[EMAIL PROTECTED]>
To: "Tom Carter" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 2:57 PM
Subject: Re: [PHP] search
> On Tue, 3 Jul 2001, Tom Carter wrote:
>
> > Rather than trying to break it into an array, you can examine the
rightmost
> > character as follows
> >
> > $search="dogs";
> > if(substr($search,-1)=='s') $search=substr($search,0,-1);
> OK, thanks. I am already breaking input search string into an array using
> a ',' as the seperator. Then I loop while there are elements in this new
> array and build the search query.
Actually strings are also arrays (at least in PHP4)...
Try this for example:
$s = 'dogs';
echo $s[strlen($s)-1];
HTH
--
Lasse
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]