Answer the question
In order to leave comments, you need to log in
How to cut a word from a string between the last slash and a dot?
Good afternoon!
For example, there is a line: /files/pages/test_image.jpeg Can
you please tell me how to cut out only the name of the image from the line, without its extension?
The variant through regular expressions interests: to cut out a word between the last slash and a point.
PS If there is a great option without using regular expressions and explode(), then I would be glad to see them.
Answer the question
In order to leave comments, you need to log in
SELECT t1.customer_id, MIN(t1.count)
FROM (
SELECT customer_id, status, count(*) as count
FROM requests
GROUP BY customer_id, status
HAVING status = "to work"
) AS t1
You can also do it without regularity:
$path = "/files/pages/test_image.jpeg";
$ext = pathinfo($path, PATHINFO_EXTENSION);
$file = basename($path, "." . $ext);
echo $file;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question