Jump to content

Question regarding arrays


ohad

Recommended Posts

Hi All,

 

I have a question regarding arrays

I get a data from a field in Oracle DB into a variable:

This is the procedure i run:

$Param_String=DBOracle::getInstance()->get_job_params($seq);

and this is what $Param_string stores after:

(string) "Id"=>"1"

Then I run this command

$parameters=array($Param_String);

Now, $Parameters is like this:

array(1) (
  [0] => (string) "Id"=>"1"
)

If i write the code that way:

$id='"1"';
$parameters=array("id" => $id);

Then, $Parameters is like this:

array(1) (
  [id] => (string) "1"
)

My problem:

I want $Parameters to be like the last option when I get the data from the database.

The string in the DB (like "Id"=>"1") can be list of such pairs seperated by comma (,). for example ("Id"=>"1", "param2"=>"test_val", "param3"=>"test_val2"...)

How can I do that?

 

 

Link to comment
Share on other sites

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.