【问题标题】:I want to store a id value in a variable ex $id=76我想将 id 值存储在变量 ex $id=76 中
【发布时间】:2019-08-01 10:56:37
【问题描述】:
Array
(
    [0] => stdClass Object
        (
            [id] => 76
            [header_left] => http://localhost/kaladisha/uploads/Lighthouse9.jpg
            [header_right] => http://localhost/kaladisha/uploads/Jellyfish3.jpg
            [content_topic] => 
            [content_subtopic] => 
            [content] => 
            [footer_img1] => 
            [footer_img2] => 
            [footer_img3] => 
            [footer_img4] => 
        )

)

我想将id的值存储在一个变量中,例如:

$id = 76

【问题讨论】:

    标签: arrays associative


    【解决方案1】:

    假设你的数组变量名是$array

    $id = $array[0]->id
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-17
      • 1970-01-01
      • 2016-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多