How do I convert %20 into a space with PHP code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AJR
    Member
    • Aug 2001
    • 61
    • 2.3.2

    How do I convert %20 into a space with PHP code?

    I am trying to store a value in a table like "Wonder%20Woman". I'm doing this because there are images with spaces associated with the value (Wonder Woman.gif).

    So I'll have this string:
    $image="<img src=\"image[name].gif\" border=\"0\" alt=\"$name2\">

    where image[name] will be 'Wonder%20Woman'

    The $name2 needs to be 'Wonder Woman' for the alt tag. Anyone know how to do this? Any help is appreciated!
    ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤
    AJ
    AJ's VPinMAME Table Downloads
    Visual Pinball Forums
    ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤
  • Mark Hensler
    Senior Member
    • Feb 2001
    • 570

    #2
    <?
    $name2 = str_replace("%20"," ",$name2);
    ?>

    or

    <?
    $name2 = urldecode($name2);
    ?>

    Read more here: urldecode(), str_replace()
    Last edited by Mark Hensler; Wed 5 Sep '01, 7:50am.

    Comment

    • AJR
      Member
      • Aug 2001
      • 61
      • 2.3.2

      #3
      Thanks!

      Thank you Max for the quick response! This will help me accomplish my task!
      ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤
      AJ
      AJ's VPinMAME Table Downloads
      Visual Pinball Forums
      ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...