Echo $var
gives me something like http://342.234.243.142/data/somethingmore/
IP-address everytime is different. Instead of "somethingmore" can something like "/folder/images/2011/gallery/file.jpg" (anything)
How do I strip from this string part with the ip and /data/ folder?
$var
could become /somethingmore/
Use this regular expression:
This way you can get a full string after '/data' even if it contains more '/' (slashes). For example,
http://342.234.243.142/data/somethingmore/andmore/