English 中文(简体)
PHP 不动产名称中的殖民地
原标题:PHP colon in property name
  • 时间:2011-11-21 11:29:55
  •  标签:
  • php
  • arrays

我有一个可变的入点:

stdClass Object ( [im:name] => stdClass Object ( [label] => Amazing Breaker ) etc.

我如何获得“阿马齐格突破”的价值?

我试图界定一个不变的定义:

define("IMNAME",  im:name );

但使用:

foreach ($json_output->feed->entry as $entry) {
if (isset($entry->IMNAME->label))

FALSE返回。

问题似乎是殖民地。 对于没有上校的钥匙,该法典将返回友好社。

最佳回答

2. 您可使用免费的同堂,为特殊财产名称提供曲折:

if (isset($entry->{ im:name }->label))
问题回答

Cur!

echo $Node->{ im:name }->label;

基本上,我们再使用。 可变变量

cur:

if (isset($entry->{IMNAME}->label))

它必须涉及的是,PHP的变量名称不能包含殖民地或双重殖民地。 See https://php.net/manual/English.variables.basics.php/a> for more information.

Does

$entry->{IMNAME}->label

工作?





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签