how to split string into array in php?

for example, i have a string variable : $str = "D:/user/data/hot.jpg"v note : i've use function "split(), explode()" but it does not work.


4/16/2019 7:15:16 AM


2 Answers

New Answer


If you mean to split the string by delimeter => "/", please see the example code. https://code.sololearn.com/wws7Pz9q12ZL/?ref=app


This will print "user ": <?php $str = "D:/user/data/hot.jpg"; $myarray=explode("/",$str); echo $myarray[1]; ?>