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

Remove first or last space

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Remove first or last space

Postby zeep25 » Mon Mar 17, 2003 6:36 pm

i have a php form .. and when the user submits that forum ... the info is added in a mysql db ..

lets say i type in :

"php rulezz"

but i want some code to check if there is a 'space' before the php (meanin in the beginnin) or after the rulezz (meanin at the end of text) .. if there is it should remove it .. so if i type in :

" php rulezz" then it would remove the first space

if "php rulezz " then it would remove the last space ..

any ideas ?
zeep25
New php-forum User
New php-forum User
 
Posts: 9
Joined: Fri Mar 14, 2003 7:23 pm

Postby Xerpher » Mon Mar 17, 2003 7:17 pm

Use trim();
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada


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.

cron