將數組轉換為PHP
Casting to Object:
The simplest method is to "cast" the array as an object:
$object = (object) $array;This approach creates a new object with the array's key-value pairs as object屬性。
使用標準類:
$object = (object) $array;此方法還遞歸地將嵌套數組轉換為對象,但與循環相比可能會產生性能。
免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3