Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
unset One of the properties of the object and Element of array
<?php //Title of this code //php 5.5.12 $format1 = <<<FIELD { "社員コード": "", "氏名": "", "フリガナ": "", "所属": "", "性別": "", "作成日": "", "更新日": "", "給与": "", "手当": "", "管理者": "", "生年月日": "" } FIELD; print "\n-----------------------------------"; print "\nJSON文字列\n"; print $format1; print "\n-----------------------------------"; print "\nオブジェクトに変換したもの\n"; $obj = json_decode($format1); print_r($obj); print "\n-----------------------------------"; print "\n『手当』プロパティを削除\n"; unset($obj->{"手当"}); print_r($obj); print "\n-----------------------------------"; print "\n配列に変換したもの\n"; $array = get_object_vars( $obj ); print_r( $array ); print "\n-----------------------------------"; print "\n配列の要素を削除\n"; unset($array["所属"]); print_r( $array ); ?>
run
|
edit
|
history
|
help
0
Exe1.php
Kkkkk
Numero aleatorio
aaaa
Boost Tiktok
ecommerce_Jamal
unset によるオブジェクトのプロパティの削除と配列の要素の削除の検証
https://rextester.com/UTIHJ60860
numeros1-100
create a short JavaScript segment