I am trying to fetch the title
and body
of a url. For this purpose, I am using the Simple HTML DOM parser library.
This is my code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
header('Content-Type: text/plain; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
include('simple_html_dom.php');
if(isset($_POST["url"])){
$html = file_get_html(dirname($_POST["url"])."/".urlencode(basename($_POST["url"])));
echo $html->find('title',0)->plaintext;
}
?>
I get the response like this:
"\u0938\u094d\u091f\u0947\u0936\u0928\u094b\u0902 \u0915\u0947 \u092c\u0940\u091a \u0928\u0935..."
How do I get the original string?