Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5483 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 3 weeks later...
Posted

Hi WingMaker,

1) Depends on the complexity of the array.

2) Depends if you want it to be human readable or are just using it for storage purposes.

If you just wanted to store the array values for example to be used again later:

1) To Store


$array = array("Item 1","Item 2","Item 3");

$storeArray = implode("n",$array);

.

.

.

$myEditCmd->setField('array',$storeArray);

$myExitCmd->execute();





2) To Retrieve



$storeArray = $record->getField('array');

$array = explode("n",$storeArray);







If you had a more complicated array and wanted to store it and retrieve it the easiest way would be as follows:



$array = array(

51255=>array("FirstName"=>"Alex","LastName"=>"Babkov","CallSign"=>"Alex Babkov"),

99124=>array("FirstName"=>"Bob","LastName"=>"Hawke","CallSign"=>"Primey")

);

$storeArray = base64_encode(serialize($array));





And to retrieve:



$storeArray = $record->getField('array');

$array = unserialize(base64_decode($storeArray));

This topic is 5483 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.