how can I combine my received json datas with my existing simple html dom query

I received json datas with the ajax post method. (The sample format what I receiving from tomorrow.php: POSTDATA=country=America&competition=Copa+Libertado&team=Boca+Juniors , content type = application/json, charset utf-8 ) via tomorrow.php at my simple html dom query file. I receive multiple json datas, so not just one POSTDATA. I would like to convert all datas to php variables. How can I do this? And How can I combine with my existing simple_html_dom query?

My existing simple html dom query (I included tomorrow.php which send the json datas with county, competition, and club)

header('Content-Type: text/html; charset=utf-8');
ini_set("user_agent", "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17");

include ("tomorrow.php");
include ("mysql.php");

ini_set('display_errors', true);

    $filename = "footballfixtures.html";
    $html = file_get_html($filename);

class matches {
    var $day;
    var $kickofftime;
    var $title;

        function matches ($day, $kickofftime, $title){
                return $this;


$day=str_replace("<h1>TODAY FOOTBALL FIXTURES: ","", $day);
$day=str_replace("</h1>","", $day);
$matchday = str_replace(array('MONDAY ', 'TUESDAY ', 'WEDNESDAY ', 'THURSDAY ', 'FRIDAY ',  'SATURDAY ',  'SUNDAY '), '', $day);
$matchday=str_replace(" ","-", $matchday);
$matchday=date('Y-m-d', strtotime($matchday));

foreach($html->find('table.fixtures') as $matches) 

    foreach ($matches->find('tr[class=a1],tr[class=a2]') as $matchesTR) {

$kodate = date('Y-m-d H:i:s', strtotime("$matchday $kickofftime +1 hour"));


$title = ucwords(strtolower($title));

echo $kodate;
echo $title;


// clean up memory


I would like to echo all my variables (like country, competition, team) what I got from tomorrow.php under $kodate and $title. How can I solve this problem? I already tried a lot of variation, but I have no result. If there is some expert who can combine this I would be very happy. Thanks.

Source: json

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.