PHP检索值-对象问题 [英] PHP retrieving values - Object problem

查看:64
本文介绍了PHP检索值-对象问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在尝试从对象中检索值.我正在使用jFormer进行表单验证和创建,并且有一个地址组件.

现在提交时,我读取了地址部分,并将读取的内容输入到变量$ address中,该变量返回以下内容:

Hello there,

I''m trying to retrieve values from an object. I''m using jFormer for form validation and creation and I have an address component.

Now on submit, I read the address component and input what is read into a variable $address, which returns the following:

print_r($address); //returns the following:

stdClass Object ( [addressLine1] => Test Address [addressLine2] => [city] => Test Road [state] => Test City [zip] => Test Post [country] => MT ) 



根据jformer上的文档,该地址返回以下内容:



According to the documentation on jformer, the address returns the following:

Value Returned

Object

Keys: { addressLine1, addressLine2, city, state, zip, country }



我想要的是分别读取每个变量.我已经阅读了很多有关键的php手册部分,但是还没有找到解决方案;/

因此,就我而言,如何将exAddressLine1设置为变量$ Address1.

请帮忙.谢谢!



What I would like is to read each variable separately. I have read lots of php manual sections regarding keys, but haven''t found a solution yet ;/

So in terms how would I set ex addressLine1 to the variable $Address1.

Please help. Thanks!

推荐答案

地址,该地址返回以下内容:
address, which returns the following:
print_r(


address); //returns the following: stdClass Object ( [addressLine1] => Test Address [addressLine2] => [city] => Test Road [state] => Test City [zip] => Test Post [country] => MT )
address); //returns the following: stdClass Object ( [addressLine1] => Test Address [addressLine2] => [city] => Test Road [state] => Test City [zip] => Test Post [country] => MT )



根据jformer上的文档,该地址返回以下内容:



According to the documentation on jformer, the address returns the following:

Value Returned

Object

Keys: { addressLine1, addressLine2, city, state, zip, country }



我想要的是分别读取每个变量.我已经阅读了很多有关键的php手册部分,但是还没有找到解决方案;/

因此,就我而言,如何将exAddressLine1设置为变量



What I would like is to read each variable separately. I have read lots of php manual sections regarding keys, but haven''t found a solution yet ;/

So in terms how would I set ex addressLine1 to the variable


Address1.

请帮忙.谢谢!
Address1.

Please help. Thanks!


这篇关于PHP检索值-对象问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆