从数组中获取帐号

时间:2016-03-17 14:04:48

标签: php arrays codeigniter

我有一个变量$accountNumber,它得到一个这样的数组:

enter image description here

我想从这个数组中获取accountNumber字符串,并将其放在另一个名为$ ac的变量中。

基本上我想要实现的是 $ ac将有字符串fi4240553120051164所以我可以将它传递给我的数据库。

基本上代码就像

$accountNumber = $bankReport->getAccountNumbersVerified();
// Now get the accountNumber string from $accountNumber and put it into $ac
$ac = //code here 

1 个答案:

答案 0 :(得分:1)

非常简单。

$ac = $accountNumber[0]->accountNumber;