Jump to content

Setting some array values dynamically at runtime


csplrj

Recommended Posts

I want to call

 

$addRecord->Documents[0]->name = 'a'

 

but as "Documents" and "name" come from runtime I tried

$addRecord->$docs[$i++]->$name = 'a'

 

But it calls instead

$addRecord->D->name = 'a'

 

I want to call $addRecord->Documents[0]->name = 'a'.

But instead it calls $addRecord->D->name = 'a'?

 

How to achieve the same

 

Thanks in advance

 

CSJakharia

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.