Encode php line code url, please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
danjapro
Forum Commoner
Posts: 72
Joined: Mon Sep 27, 2004 10:56 am

Encode php line code url, please help

Post by danjapro »

Need a little direction with this.

I am trying to encode this line so it write the URL dislayed as somewhat encode form souorce viewer.

The URL:
http://sitepoint.com/images/user/media/song.mp3

I would like it to appear as something gebirsh or encoded:

http://%%5dfsitepoint%%%/@#$%%./CD%20%%%%&*


Line

Code: Select all

$js_songs_url[] = "songs_position_url[".$i."] = '".MusColHelper::getSongFileURLslashes($songs[$i])."';" ;

I have tried these methods none work


Code: Select all


$js_songs_url[] = mb_convert_encoding("songs_position_url[".$i."] = '".MusColHelper::getSongFileURLslashes($songs[$i]))."';" ;

$js_songs_url[] = rawurldecode("songs_position_url[".$i."] = '".MusColHelper::getSongFileURLslashes($songs[$i]))."';" ;

$js_songs_url[] = html_entity_decode("songs_position_url[".$i."] = '".MusColHelper::getSongFileURLslashes($songs[$i]))."';" ;

$js_songs_url[] = preg_replace("songs_position_url[".$i."] = '".MusColHelper::getSongFileURLslashes($songs[$i]))."';" ;



NONE worked for me...
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Encode php line code url, please help

Post by social_experiment »

“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply