php - Get a Sub String starting from a certain character of a long string. -
There is a problem getting a sub string starting with a certain letter of my long string, but I'm having such a string That's what I do not want.
This is my string
$ school_title = Bangata Elementary School - P0101001
I To get the P0101001
what I have done
< $ index_num = stristr ($ school title) , "- P", incorrect);
This function output is to be excluded from - P0101001
I '-'
How can I do this?
$ school_title = 'Bangata Elementary School - P0101001'; $ Index_num = substr ($ school_title, Stropo ($ school_title, "-P") + 2); Echo $ index_num; // P0101001
Comments
Post a Comment