Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个用 json_decode 创建的 PHP 变量。
结果的第一个字段有一个我存储在变量中的名称。
那么我如何通过存储在变量中的名称访问该字段呢?
我试过了:
$json_decoded->{$item}
但它返回 null....
$v = "b"; $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; $d = json_decode($json); echo $d->$v;
另一种方式
$v = "b"; $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; $d = json_decode($json,true); echo $d[$v];
不使其成为变量:
$json_decoded->item
我只能访问 .ascx 文件而不是代码隐藏。
我希望能够仅显示<asp:label控件返回的字符串的左侧部分。
<asp:label
我考虑过将标签设置为display:none; 并添加第二个<a
display:none
<a