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
hidz_stitch
Forum Newbie
Posts: 2 Joined: Wed May 13, 2009 8:08 am
Post
by hidz_stitch » Wed May 13, 2009 8:46 am
Help!!
Can anybody tell me is there any way to ascii encode the pdf file then do the url encode and vice versa?
pdf file -> ascii encode -> url encode
url decode -> ascii decode -> pdf
can anyone show me the example??
I really stuck on it..
Darhazer
DevNet Resident
Posts: 1011 Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria
Post
by Darhazer » Thu May 14, 2009 3:31 pm
Code: Select all
$content = file_get_contents($pdfFile);
$ascii = base64_encode($content);
$url = url_encode($ascii);
$ascii = url_decode($url);
$content = base64_decode($ascii);
Any questions?
Last edited by
Benjamin on Thu May 14, 2009 4:21 pm, edited 1 time in total.
Reason: Changed code type from text to php.