Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用print_r($arr),它打印出以下内容:
print_r($arr)
stdClass Object ( [uid] => 1 [status] => complete [order_id] => 430 )
我如何访问这些值?
我努力了:
print $arr->order_id;
但它不返回任何东西。
<?php $a = array ( "uid" => 1, "status" => "complete", "order_id" => 430, ); $a = (object)$a; echo $a->order_id; // 430
这工作正常。