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

PHP URL Encoding Question

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP URL Encoding Question

Postby paintitblack » Mon Feb 17, 2014 8:56 pm

I need to convert this:

Code: Select all
/page-name/?q=search+term


to this for use in an HTML form field:

Code: Select all
/page-name/?q=search&#043term


However, I can't find which PHP function does this particular conversion/encoding.

Any ideas?

Thanks!
paintitblack
New php-forum User
New php-forum User
 
Posts: 8
Joined: Mon Feb 17, 2014 8:53 pm

Re: PHP URL Encoding Question

Postby macek » Mon Feb 17, 2014 11:36 pm

User avatar
macek
php-forum Active User
php-forum Active User
 
Posts: 277
Joined: Wed Aug 25, 2010 10:42 am

Re: PHP URL Encoding Question

Postby paintitblack » Tue Feb 18, 2014 3:16 pm

Thanks, but I'm still not seeing an option to generate the format I need.
paintitblack
New php-forum User
New php-forum User
 
Posts: 8
Joined: Mon Feb 17, 2014 8:53 pm

Re: PHP URL Encoding Question

Postby seandisanti » Thu Feb 27, 2014 10:18 am

That is the name of the function....htmlentities($_SERVER['REQUEST_URI']) is exactly what you're looking for.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


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