ho varie strighe del tipo
img1.jpg||0||
ecc., tutte di lunghezza diversa.
mi serve poter tagliare le stringhe a jpg, cioè togliere tutto quello dopo jpg.
come si fa?
ho varie strighe del tipo
img1.jpg||0||
ecc., tutte di lunghezza diversa.
mi serve poter tagliare le stringhe a jpg, cioè togliere tutto quello dopo jpg.
come si fa?
Codice PHP:
echo substr($str,0,strpos($str,'jpg')+3);