High score please sage pointing stdClass Object to array

Source: Internet
Author: User
High score please tall man pointing stdClass Object to array
Please big brother pointing out, Google is not the answer to the post trouble everyone. High Score!
Problem:
I've got an array $array formatted with JSON as follows

Array
(
[0] = = StdClass Object
(
[Num_iid] = 6000026492
)

[1] = = StdClass Object
(
[num] = 6000026308
)

[2] = = StdClass Object
(
[num] = 6000025528
)

[3] = = StdClass Object
(
[num] = 6000025650
)

[4] = = StdClass Object
(
[num] = 6000027082

I want to get the array for
$array [0]=6000026492
$array [1]=6000026308
.................
How do I convert
Try not to use for, because the data is very much, call frequently, there is no best way to convert.




------Solution--------------------
Provide a clue: you send the JSON string, it is recommended to process the JSON string directly. For example, with some regular expressions or something, or simply str_replace.
------Solution--------------------
This post was last edited by xuzuning on 2011-07-27 08:29:46

You should be receiving JSON data like this.
$s = ' [{' num ': 123},{' num ': 456}] ';
$t = Json_decode ($s, 1);//decode to cast an array
Then the array is reduced to dimension
$p = Array_map (' current ', $t);
Finally connected to a string
echo implode (', ', $p);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.