Jump to content

Recommended Posts

The Joomla ZOO extension places information within a multi-dimensional array named $elements.

I display the array structure with:

$arr = json_decode($elements,true);echo <pre>",print_r($arr,true),"</pre>";

 

The resulting array is below.

Array

(

[a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5] => Array

(

[0] => Array

(

[value] => Telephone Number

)

)

 

[e3145090-5017-44a9-bfaa-64602bacf96f] => Array

(

[0] => Array

(

[value] => Fax Number

)

)

)

 

I need to be able to replace the value associated with a specific identifier ie. replace the ‘Telephone Number’ with another string $newdata, as this is associated with the identifier ‘a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5’.

I am new to this, but my initial attempt was as follows.

$newdata = “ABCD”;

foreach($elements as &$value)

{

$value['a3f9a1ba-85a2-4142-b0d6-6a85bef30cb5'] = $newdata;

}

 

This seems to have absolutely no effect. Can someone point me in the right direction.

 

Thanks, Alec

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.