note 20885 rejected from function.eregi-replace by sander

From: Date: Sat, 20 Apr 2002 09:26:56 +0000
Subject: note 20885 rejected from function.eregi-replace by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29601@lists.php.net to get a copy of this message
To trim off excess spaces and spaces at both ends of a string. You don't need to use eregi_replace(). You can simply use the function trim() like this: $a = " hello world "; $b = trim($a); echo $b; //will display 'hello world'

« previous php.notes (#29601) next »