I have s tring that look like this
"143s (2m 23s)",
and I want to turn it in to this
"143",
I'm triyng to use preg_replace, but I cant get it to work
$file = "\"143s (2m 23s)\",";
$file = preg_replace("/[0-9]*(s*.*)/", "", $file);
echo $file;
Thank you
Answer:
$file = preg_replace('/("\d+)s.*(\",)/', '$1$2', $file);