note 49271 deleted from function.substr-replace by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 Feb 2009 06:23:51 +0000 |
| Subject: | note 49271 deleted from function.substr-replace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150669@lists.php.net to get a copy of this message | ||
Note Submitter: ogt at parasane dot com
----
Actually, just a minor correction to tekrat at 2d dot com's post:
Change the code....
<?
if(strlen($substring) < 1){
$string = $rep;
}else{
$string = $substring;
}
?>
.... into....
<?
if(strlen($substring) >= 1){
$string = $substring;
}
?>
.... otherwise you'll end up with the elipses (...) for any null strings.