note 93381 deleted from function.ltrim by danbrown
| From: | danbrown@php.net | Date: | Mon, 07 Sep 2009 12:38:28 +0000 |
| Subject: | note 93381 deleted from function.ltrim by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160277@lists.php.net to get a copy of this message | ||
Note Submitter: Leo
----
@John Sherwood:
to me:
<?php
$bsn = preg_replace('/\D/', '', $_POST['bsn']); // Strip any
non-digit
$bsn += 0; // easy way to trim padding zeroes
?>
doesn't do the same as:
<?php
$bsn = ltrim(preg_replace('/\D/', '', $_POST['bsn']),
"0"); // Strip any non-digit + left padding zeroes
?>
so I guess , the += 0 trick doesn't work well.