循环对象(stdClass)#1

object(stdClass)#1 (1) {
  ["trackingNo"]=>
  array(18) {
    [0]=>
    string(15) "
888005324912

"
    [1]=>
    string(16) "
1900530244582

"
    [2]=>
    string(15) "
778180519352

"
    [3]=>
    string(16) "
1000237325384

"

How do i loop through a data like this? When i do a var_dump on this $obj , it returns the data above but when i do a echo $obj, i get nothing. Any idea why is that so too?

$obj = json_decode(file_get_contents("php://input"));

The object contains an array, do it like this.

foreach($obj->trackingNo as $trackingNo){
    echo $trackingNo."
";
    /*Or whatever you want to do with $trackingNo.*/
}