note 57271 added to function.trim

From: Date: Thu, 29 Sep 2005 06:00:18 +0000
Subject: note 57271 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-95949@lists.php.net to get a copy of this message
i have this project that parses html to extract some values, like the one from jobsites. now the problem is the filed im to extract looks like this on the source codes name surname i did a trim, but it only deals with the front and end of the string, not on the inside, i formulated a str_replace function, but if im going to replace all ' ' (whitespaces), the values will merges 'val1val2' right? how can i delete all unnecessary whitespaces, and leave only one in between words in a string, like if var='lance vincent' var should be var='lance vincent' ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57271 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57271&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57271&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95949) next »