-4

If I have a string like this: value1/value2/value3/ how can I get it into an array?

$array = "value1/value2/value3/"
echo($array[0]); // returns value1

? please help?

1 Answers1

3

Use explode:

$array = explode('/', "value1/value2/value3");
echo $array[0];
Barmar
  • 741,623
  • 53
  • 500
  • 612