take out the spaces and any special characters

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 31
Joined: Sat Jun 28, 2003 9:09 pm

take out the spaces and any special characters

Post by 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.


(Im new)

User avatar
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

use trim and regular exp

Post by 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

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests