I'm trying to remove from a string everything start with /
char, so if I have
my_value/j/im<b*+èo[/h>e\ylo
I'd like to remove the string /j/im<b*+èo[/h>e\ylo
and return only my_value
.
I thought to use something with str_replace
but I'm not a great regex programmer and I'm doing practise with php.
function clean_value ($value) {
return preg_replace ("^(/.*?)$", "", $value);
}
How can I do?