Answer the question
In order to leave comments, you need to log in
Php - How to remove \r\n?
<?php
$rs = "https://en.search.wordpress.com/?q=tim+cook&f=json";
$chp = curl_init($rs);
curl_setopt($chp, CURLOPT_HEADER, 0);
curl_setopt($chp, CURLOPT_RETURNTRANSFER,1);
curl_setopt($chp, CURLOPT_SSL_VERIFYPEER,0);
$resultp=curl_exec($chp);
curl_close($chp);
$decode = json_decode($resultp, TRUE);
foreach($decode as $res) {
$scontent = $res['content'];
$scontent = str_replace('\r\n', ' ', $scontent);
echo "".$scontent."";
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question