|
|
|
|
|
$new = ereg_replace(" +$","",$old);
The '$' indicates the end of the string, and " +" means 1 or more spaces.
By the way, you may want to have a look at PHP's chop() function.
See http://ca.php.net/manual/function.chop.php3 |
|
| Finding numbers within a string Categories : PHP, Regexps, Strings | | | What is the best way to split a string that consists of two bits of data
seperated by whitespace? Categories : Regexps, Strings, PHP | | | columned txt file to array()? Categories : Arrays, Strings, Regexps, PHP | | | Massreplace Categories : Filesystem, Regexps, Strings, PHP | | | Making sure a string containes only digits or no digits. Categories : Strings, PHP, Regexps | | | String Replacement and speed consideration
Categories : PHP, Strings, Regexps | | | Avoiding or Detecting high bit characters in a string. Useful when you want to create a valid RSS feed Categories : PHP, Strings, Unicode, Regexps, Rich Site Summary (RSS) | | | Extract keywords from a string having words in " " count as one string. Categories : PHP, Strings, Regexps, Search | | | explode() and SQL blobs Categories : General SQL, Strings, PHP, Databases | | | This script is a contact form between users of a
website (kinda like the PM function on the forums)
Categories : PHP, Databases, MySQL, Regexps | | | A simple configuration file editor to ease you life in setting up php applications. Reads variables from a given file automatically and displays current value. New value will be written to file after submit. Categories : PHP, Filesystem, Regexps, Java Script | | | Class TStringList include some metods from class TStringList
implemented in INPRISE/BORLAND-DELPHI Categories : PHP Classes, PHP, Strings | | | textwrap fill-paragraph (justification) Categories : Strings, PHP, Algorithms | | | Parse html (title :: meta) Categories : PHP, HTML and PHP, Regexps | | | Read a file with strings and create a new file with the
first half of each string Categories : PHP, Strings, Filesystem | |
| |
| |
|