Jump to content

[SOLVED] searching for consecutive six 0-9 numbers in a string


hammadtariq

Recommended Posts

Hello Guys,

          I have a task in hand in which I am getting strings which are in fact subjects of emails and they are like

 

"This should be done! 568975/12/tinup"

"456789 is your reference"

"I am in 456789 area"

 

All I need is to take out consecutive six matching numbers and that will be my reference number. Reference number is always in six digits and I need to take out any occurance of six digit numbers and stripping out everything else. I considered using strspn() but thats not working I guess that is not for search like this and I am really bad in using preg_match, can any one help me please?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.