Hello I have string as : $string="/inbox/?rfbafefaa&r3b54c457&compose&ids=645976873&refid=5"; Lets say i wanna capture only 645976873 (Its in ids=645976873) in some variable. Can anyone tell me how to do that? Its a simple string. and generated randomly everytime. Every field will have randing numbers (/inbox/?r, &compose, &ids, &refid words always gunna b there in string) . I wanna know how do capture string contents starting from specific word till specific ending word? (P.S. Its a string and not received from any form etc. So please dont suggest me $_GET['ids'])