note 83115 added to function.str-replace

From: Date: Sat, 10 May 2008 22:59:16 +0000
Subject: note 83115 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-139258@lists.php.net to get a copy of this message
<?php function str_clean($str) { // KG6YPI, Brandon Hansen // removes extra whitespaces and new lines // while preserving spaces in words, sentances, etc. $strip_this=array(" ","\n","\r"); // convert to our own special marker $str=str_replace($strip_this,"<!ypi!>",$str); // remove doubles $str=str_replace("<!ypi!><!ypi!>","",$str); // convert singles to spaces and trim $str=trim(str_replace("<!ypi!>"," ",$str)); return $str; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 99.140.7.55 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/83115 Del: integrated -- https://master.php.net/note/delete/83115/integrated Del: useless -- https://master.php.net/note/delete/83115/useless Del: bad code -- https://master.php.net/note/delete/83115/bad+code Del: spam -- https://master.php.net/note/delete/83115/spam Del: non-english -- https://master.php.net/note/delete/83115/non-english Del: in docs -- https://master.php.net/note/delete/83115/in+docs Del: other reasons-- https://master.php.net/note/delete/83115 Reject -- https://master.php.net/note/reject/83115 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139258) next »