note 43581 added to function.str-replace

From: Date: Sat, 26 Jun 2004 14:07:55 +0000
Subject: note 43581 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-71776@lists.php.net to get a copy of this message
If you would like to convert tabs to spaces, you could use the code: <?php str_replace("\t", " ", $text); ?> However, sometimes this is not good enough. To be technically correct, a tab is not 4 spaces, a tab shifts the text to the next predefined column. Usually these predefined columns occur every 4 spaces from the start of the line. If you want to convert tabs to spaces while ensuring consistant formatting, try this function... http://ircphp.com/users/imho/?file=function.tab2space.php ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43581 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43581&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43581&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71776) next »