newb Posted January 7, 2009 Share Posted January 7, 2009 is there a function that grabs only part of a string. for example, theres a bunch of text in one string, but i only want the text that says '<b>'. how do i grab it? anyone know? Quote Link to comment https://forums.phpfreaks.com/topic/139801-solved-how-to-grab-a-string-lol/ Share on other sites More sharing options...
MatthewJ Posted January 7, 2009 Share Posted January 7, 2009 http://us3.php.net/preg_match Quote Link to comment https://forums.phpfreaks.com/topic/139801-solved-how-to-grab-a-string-lol/#findComment-731380 Share on other sites More sharing options...
newb Posted January 7, 2009 Author Share Posted January 7, 2009 ty sir. Quote Link to comment https://forums.phpfreaks.com/topic/139801-solved-how-to-grab-a-string-lol/#findComment-731387 Share on other sites More sharing options...
RussellReal Posted January 7, 2009 Share Posted January 7, 2009 but bro.. if you already KNOW you want <b> why not just use <b> unless you want the contents that are inside <b></b> in which case you can use preg_match or substr + strpos the second option is actually TONS faster Quote Link to comment https://forums.phpfreaks.com/topic/139801-solved-how-to-grab-a-string-lol/#findComment-731488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.