久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何實(shí)現(xiàn)數(shù)組轉(zhuǎn)object

      php實(shí)現(xiàn)數(shù)組轉(zhuǎn)object的方法:【$array=array('xxx'=>'xxx'); $vl=json_encode($array); $ob=json_decode($vl); print_r($ob);】。

      php如何實(shí)現(xiàn)數(shù)組轉(zhuǎn)object

      本文操作環(huán)境:windows10系統(tǒng)、php 7、thinkpad t480電腦。

      數(shù)組與object的相互轉(zhuǎn)換:

      1、數(shù)組轉(zhuǎn)Object

      $array=array('a' =>'哈哈','b' =>'bnbbbb','西' =>'嘻嘻嘻'); $vl=json_encode($array); $ob=json_decode($vl);  echo "<pre>";  print_r($ob);

      2、Object轉(zhuǎn)數(shù)組

      在Object變量前加 (array) 示例1: 	$data=(array)$Object; 	var_dump($data);   示例2: //或者調(diào)用這個(gè)函數(shù),將其幻化為數(shù)組,然后取出對(duì)應(yīng)值 function object_array($array) {    if(is_object($array))    {     $array = (array)$array;    }    if(is_array($array))    {     foreach($array as $key=>$value)     {      $array[$key] = object_array($value);     }    }    return $array; }

      推薦學(xué)習(xí):php培訓(xùn)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)