note 22090 added to function.str-pad
| From: | pestilenc at hotmail dot com | Date: | Thu, 06 Jun 2002 08:26:44 +0000 |
| Subject: | note 22090 added to function.str-pad | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31524@lists.php.net to get a copy of this message | ||
For me this worked.
$string = 'help';
#First, str_pad() with unique character.
$string = str_pad($string, 10, "*", STR_PAD_BOTH);
#$string = '***help***';
#Second, str_replace with ' '
$string = str_replace("*", " ", $string);
--
http://www.php.net/manual/en/function.str-pad.php
http://master.php.net/manage/user-notes.php?action=edit+22090
http://master.php.net/manage/user-notes.php?action=delete+22090
http://master.php.net/manage/user-notes.php?action=reject+22090