Php Classroom image

Anil  Bist / Professional / Web Technology
 
To post your Question Join Classroom
 
Question No  (1 of 137)
 1 I 2 I 3 I 4 I 5 I 6 I 7 I 8 I 9 Last
 
Question:-
Is it possible to protect special characters in a query string?
 
Answer:-

urlencode function and rawurlencode are mostly based on RFC 1738.

However, since 2005 the current RFC in use for URIs standard is RFC 3986.

Here is a function to encode URLs according to RFC 3986.

<?php
function myUrlEncode($string) {
    $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
    $replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
    return str_replace($entities, $replacements, urlencode($string));
}
?>

Yes, we use the urlencode() function to be able to protect special characters.

Prev   
 
 
 
image
Anil  Bist

Skills    Php

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,
Description:-

in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail" this is my first web development framework and we worked in this framework and develop four to five project after some time , I moved to JEE/Sturst frame work,

After some time i decided that now times come and I have to go on in my own way and I started a company name is "Soarlogic&q
Explore

 

  Students (9)

Ask 
image
shubham
Ask 
Monika
Ask 
Anamika
Ask 
Riya
Ask 
image
Pooja
Ask 
Richa
Ask 
image
prateek
Ask 
Neha
Ask 
image
Amit
 
 

Recommended Classes

Rajendra Kumar
I have more then 5 year of Mobile App Development Experience and have worked in Android Native, I...
Professional
image Anil Bist
in 2006, i Join a web development company in Bangalore and start work on "Ruby on Rail"...
Professional
image Sandeep Srivastava
I am working as software develop from last 9 year.worked in Java, Struts, SpringMVC, Hibernate.
Professional