I have a string like this:
$imgs = "uploads/images/adsense.png|uploads/images/tree-7835_960_720.jpg|uploads/images/way-427984_960_720.jpg|uploads/images/friendship-1081843_960_720.jpg|uploads/images/pinky-swear-329329_960_720.jpg"
I want only the part that refers to the first image:
uploads/imagens/adsense.png
How can I use regex to filter for the content before the first |
?
$image = preg_replace(/(*)(\/*)/, $1 ,$imgs)