I am having a string as follows:
$str = ,1,2;
I used explode method and make an array as follows:
$idsArray = explode(",",$str);
I print the array as follows:
print_r($idsArray);
The result I got is as follows:
Array(
[0]=>
[1]=>1
[2]=>2
)
I need a result as
Array(
[0]=>1
[1]=>2
)
How can I correct it and make the expected result?