Fun at zangOOr Click Here
0 like 0 dislike
404 views
I have this string

$string = 'tmy-string-sssss-1134';

I need to have 1134 out of this string

basically i want to pick up the last instance of " - ".
in Education & Reference by (840 points) | 404 views

1 Answer

0 like 0 dislike
Best answer

$string = 'tmy-string-sssss-1134';

$result = array_map('strrev', explode('-', strrev($string)));

// print_r($result);

echo $result[0];

by
selected by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1.4k points) | 876 views
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Jul 7, 2014 in Education & Reference by Bhoomika (-30 points) | 22.9k views
0 like 0 dislike
1 answer
asked Apr 18, 2014 in Education & Reference by Yogi (410 points) | 118 views
1 like 0 dislike
1 answer
asked Apr 15, 2014 in Education & Reference by Yogi (410 points) | 163 views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,250 questions
1,404 answers
565 comments
4,809 users