Home > Mobile >  How to store the string values into an array in php?
How to store the string values into an array in php?

Time:04-06

I have one parameter every time it comes from the request object in a standard order,I want to store that string into an array by splitting \for that i am using explode function it's throwing an error,please help me to explode with backslash

$obj = "App\Http\Data\User";
$array = explode("\",$obj);

CodePudding user response:

You can use this:

$obj = "App\Http\Data\User";
$array = explode("\\",$obj);


print_r($array);

example here

  • Related