note 22414 deleted from function.str-pad by cmb
| From: | cmb@php.net | Date: | Mon, 31 Aug 2015 21:07:05 +0000 |
| Subject: | note 22414 deleted from function.str-pad by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203546@lists.php.net to get a copy of this message | ||
Note Submitter: cj at NOSPAM dot ceejayoz dot com
----
Another solution to no_email@php.net's problem would be to simply multiply the padding string
by 6.
e.g.
$string = str_pad($string, 10, " ", STR_PAD_BOTH);
becomes
$string = str_pad($string, 60, " ", STR_PAD_BOTH);
which will avoid problems with the above solution, which will mess up text that has the * in it (or
whichever character you're replacing)