Then why don't you just trim() it before comparing?
$var = trim($var);

Niklas


-----Original Message-----
From: B. Verbeek [mailto:[EMAIL PROTECTED]] 
Sent: 31. tammikuuta 2002 13:33
To: [EMAIL PROTECTED]
Subject: RE: [PHP] question reg trim-strlen


I want to trim it then check and the new var must stay trimmed!

-----Oorspronkelijk bericht-----
Van: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 31 januari 2002 11:55
Aan: Php-General
Onderwerp: RE: [PHP] question reg trim-strlen


I think it won't work.

If you don't want to trim the actual variable, but check if the trimmed
variable is longer than 50 chars, here you go:

if (strlen(trim($cust_adres)) > 50)
{
        ....
}


Niklas

-----Original Message-----
From: B. Verbeek [mailto:[EMAIL PROTECTED]]
Sent: 31. tammikuuta 2002 12:48
To: Php-General (E-mail)
Subject: [PHP] question reg trim-strlen


 Does this work?

 >>    if(strlen($cust_adres = trim($cust_adres)) > 50){ /*code here*/ }

 I mean that the new $cust_adres is trimmed when nessecary?

 regards
 Bart




--
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]


--
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]





--
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]

Reply via email to