當前位置:編程學習大全網 - 網站源碼 - new stdClass()的例子

new stdClass()的例子

<?php

function arrayToObject($array) {

if(!is_array($array)) {

return $array; }

$object = new stdClass();

if (is_array($array) && count($array) > 0) {

foreach ($array as $name=>$value) {

$name = strtolower(trim($name));

if (!empty($name)) {

$object->$name = arrayToObject($value);

}

}

return $object;

}

else { return FALSE; }

}

>

  • 上一篇:豐南河套老街什麽時候建成
  • 下一篇:如何破解zend源碼對域名權限獲取
  • copyright 2024編程學習大全網