File "ajax-test.php"

Full Path: /home/analogde/www/Tableau/ajax-test.php
File size: 951 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

 

$str_json = file_get_contents('php://input'); //($_POST doesn't work here)
$response = json_decode($str_json, true); // decoding received JSON to array

	//echo "----> " .count($response);

	// OK  ABC
	//echo " ----->>> "	.$response[0][0];
	
	//echo " ----->>> "	.count($response[0]);
	
	// lecture 
	
	echo gettype($response), "\n";
	
	for ($i = 0; $i < count($response); $i++) 
	{
		for ($j = 0; $j < count($response[$i]); $j++) 
		{
			echo $response[$i][$j];
			echo "<br>";
		}
	}
	
	
//$name = $response[0];
//$age = $response[1];


/*
$lName = $response[0];
$age = $response[1];

echo '
<div align="center">
<h5> Received data: </h5>
<table border="1" style="border-collapse: collapse;">
 <tr> <th> First Name</th> <th> Age</th> </tr>
 <tr>
 <td> <center> '.$lName.'<center></td>
 <td> <center> '.$age.'</center></td>
 </tr>
 </table></div>
 ';*/
 
 //echo $name ."  " .$age;
 
 
?>