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

Popular posts from this blog

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

sql - PostgreSQL automatically update row at specific date -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -