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
https://forums.phpfreaks.com/topic/149278-solved-replace-space-character-problem/
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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.