Home » Php » php – How to Make String Type Become Array Type

php – How to Make String Type Become Array Type

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have input field that i fill array when i dump that array become string type.

my input on field :
[‘name’=>’juned’]

Condition :

$value = "array()";

Expected Output :

$value = array();

I want to fill input with array type and get it as array type again.

Please help me, thank you.

How to&Answers:

Would something like this work for you?

if ($value == "array()")
    $value = array();