[EMAIL PROTECTED]
Subject: Re: [PHP] Re: Using Logical OR operator in IF statement???
>> if (substr($sString,(strlen($sString)-1)!="-")) {
I think you meant either
substr($sString,strlen($sString)-2)
or
substr($sString,-1)
>> print "You can't have a dash at the end
>> if (substr($sString,(strlen($sString)-1)!="-")) {
I think you meant either
substr($sString,strlen($sString)-2)
or
substr($sString,-1)
>> print "You can't have a dash at the end of your string.";
>> }
>>
>> and this works:
>> if (substr($sString,0,1)!="-") {
>> print "You can't have a dash at
Ok, it works!! Thanks to everyone for their suggestions and answers. This
group is a great resourse. Thanks again
...Brad
"Brad Melendy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks James,
> I tried a regular expression comparison first, but
Thanks James,
I tried a regular expression comparison first, but it was eluding me. I'm
new to PHP (trying to convert form ASP) and part of this is me trying to
convert my ASP/VBSCRIPT to PHP. ;-) I actually have a FOR loop evaluated
when the conditions of the IF statement are met, and I suspec
Hi Brad,
This worked for me:
.. but I'd tend to go for a regex as a solution to what you're after,
which involves less code:
Just my thoughts...
James
"Brad Melendy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> Ok, this works:
>
> if (su
5 matches
Mail list logo