Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

take out the spaces and any special characters

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

take out the spaces and any special characters

Postby pugs421 » Thu Jul 03, 2003 5:40 pm

how exactly would i edit this line to take out spaces and special charaters that might cause a problem when contained in the name of a file.

$_SESSION['screen_name'];


(Im new)
pugs421
New php-forum User
New php-forum User
 
Posts: 31
Joined: Sat Jun 28, 2003 9:09 pm

use trim and regular exp

Postby ruturajv » Fri Jul 04, 2003 5:53 am

This is the function to remove trailing and leading white spaces

Code: Select all
trim (string str [, string charlist])


you can use str_replace( " ", "", $str) this will replace all blank spaces by no space
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.