Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th May 2012, 07:12
Padilpi Padilpi is offline
Junior Member
 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do I use PHP to convert a single character into a string of characters?

I want to use PHP to find any / that is in a variable which can be called via $_GET. This variable is the end part of a document URL. The URL will be fed into Google Document Viewer. However, the embedded document URL should use %2F instead of /. Is it possible to use PHP to say "every time I see /, I replace it with %2F"?

Online Deals India

Last edited by Padilpi; 26th May 2012 at 06:44.
Reply With Quote
Sponsored Links
  #2  
Old 25th May 2012, 09:56
nicephotog nicephotog is offline
Junior Member
 
Join Date: Nov 2008
Location: Australia
Posts: 19
Thanks: 0
Thanked 2 Times in 2 Posts
Default

The action you want is called "URL encoding".
Any information beyond the URL filename and internal document # anchor following the filename which can then be followed by ?formname=... and one more obscurity that is generally only found in specialist web servers http call syntax method to screen unique server platform idiosynchratic commands appended to a url
must be URL encoded.
In php with normal web server operation variables returned by php are automatically URL decoded.

http://php.net/manual/en/function.urlencode.php
Reply With Quote
  #3  
Old 5th June 2012, 01:23
arifur arifur is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

Url Encoding:
http://php.net/manual/en/function.urlencode.php

Url Decoding:
http://php.net/manual/en/function.urldecode.php

You can find all you need from here.
__________________
abouthack.com
arifur.net
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Only Problems since Updating from 3.0.3.3 to 3.0.4.1 mbay General 4 17th May 2012 12:56
ubuntu and nginx delgado2061 Installation/Configuration 0 27th November 2011 23:36
Problem with services!! banzaiwebstudio.com Installation/Configuration 7 19th May 2010 21:13
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 01:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.