I have a string as
$line = "Name=johnGender=M";
How to make a string called $name
that will have a value stored as john
.
How to extract a sub-string which is enclosed between =
and G
in the string $line.
OR grab a sub-string of 4 characters from the first encounter of =
(this will work for me).
What if $line=array("Name=john&Gender=M",Name=carl&Gender=M",);
And I wanted to put them in an array $name
So that $name=array("john", "carl");