Jump to content

[SOLVED] replace space character problem


maddogandnoriko

Recommended Posts

I am trying to replace space characters returned in short an html string with nothing to help me build a regex statement. I tried this with no joy:

$thtml = str_ireplace(' ','',$thtml);

 

and here is the string:

 

{"links_existed":{1958300:{"id_str":"1958300", "filename":"bw.0102.part1.rar", "size":"104857600", "download_url":"http://depositfiles.com/files/1958300"}, 1958303:{"id_str":"1958303", "filename":"bw.0102.part2.rar", "size":"104857600", "download_url":"http://depositfiles.com/files/1958303"}, "ve4w82ro7":{"id_str":"ve4w82ro7", "filename":"DFManagerSetup.exe", "size":"1063760", "download_url":"http://depositfiles.com/files/ve4w82ro7"}}, "links_deleted":{1493393:{"id_str":"1493393", "filename":"Cap.iKA.part1.rar", "size":"104750000", "download_url":"http://depositfiles.com/files/1493393"}}}

 

Link to comment
Share on other sites

This:

<?php
$x = '{"links_existed":{1958300:{"id_str":"1958300", "filename":"bw.0102.part1.rar", "size":"104857600", "download_url":"http://depositfiles.com/files/1958300"}, 1958303:{"id_str":"1958303", "filename":"bw.0102.part2.rar", "size":"104857600", "download_url":"http://depositfiles.com/files/1958303"}, "ve4w82ro7":{"id_str":"ve4w82ro7", "filename":"DFManagerSetup.exe", "size":"1063760", "download_url":"http://depositfiles.com/files/ve4w82ro7"}}, "links_deleted":{1493393:{"id_str":"1493393", "filename":"Cap.iKA.part1.rar", "size":"104750000", "download_url":"http://depositfiles.com/files/1493393"}}}';
$z = str_replace(' ','',$x);
echo $z . "<br>\n";
?>

 

works fine.

 

Can you post more of your code?

 

Ken

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.