PHP URL Function Example urldecode()

php url function example urldecode() - decodes encoded url or string

php url function example urldecode() which decodes encoded url or string and returns the decoded string. This function decodes any %## character encoding in the given encoded string.

php-url-function-example-urldecode.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>php url function example urldecode - decodes encoded url or string</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="Author" content="Md Iqbal Hosan">
  <meta name="title" content="php url function example urldecode - decodes encoded url or string - returns the decoded string">
  <meta name="keywords" content="php, example, code, urldecode">
  <meta name="description" content="php url function example urldecode - decodes encoded url or string - returns the decoded string">
  <style>
   h2, h4{background:orange; color:#000085;}
   h2{ padding:3px; margin:3px; font-size:22px;}
   h4{ padding:2px; margin:2px; font-size:18px;}
   p{padding:2px; margin:2px; color:#0099Fe;}
   body{ background:#FFFFFc;}
  </style>
 </head>
 <body>
  <h2>php url function example urldecode - decodes encoded url or string</h2>
  <?php $MyAdmirePerson = "The person i admire most is cfsuman. His favorite color is also Orange."; ?>
  <h3>MyAdmirePerson = <?php echo $MyAdmirePerson; ?></h3>
  <?php
   /*
    ------------------------------------------------------------------------
     encodeing the given string by using urldecode() php url function
    ------------------------------------------------------------------------
   */
   $EncodedMyAdmirePerson = urlencode($MyAdmirePerson);
  ?>
  <h3>EncodedMyAdmirePerson = <?php echo $EncodedMyAdmirePerson; ?></h3>
  <?php
   /*
    ----------------------------------------------------------------------------------------------
     decodeing the EncodedMyAdmirePerson encoded string by using urldecode() php url function
    ----------------------------------------------------------------------------------------------
   */
   $DecodedMyAdmirePerson = urldecode($EncodedMyAdmirePerson);
  ?>
  <h3>DecodedMyAdmirePerson = <?php echo $DecodedMyAdmirePerson; ?></h3>
 </body>
</html>

PHP URL Function Example urldecode() - output in the browser

No comments:

Post a Comment

leave your comments here..