RE: [PHP] question reg trim-strlen
| From: | Niklas Lampén | Date: | Thu, 31 Jan 2002 12:52:46 +0000 |
| Subject: | RE: [PHP] question reg trim-strlen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-82918@lists.php.net to get a copy of this message | ||
Then why don't you just trim() it before comparing?
$var = trim($var);
Niklas
-----Original Message-----
From: B. Verbeek [mailto:b.verbeek@creative-edge.nl]
Sent: 31. tammikuuta 2002 13:33
To: niklas.lists@publico.fi
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:niklas.lists@publico.fi]
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:b.verbeek@creative-edge.nl]
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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net