joshblue Posted May 19, 2008 Share Posted May 19, 2008 What function can I use to find a particular string in a line? e.g. line1 -> "hello world, its me!" The program would search for "its me!" for example. If it finds, it will echo that line... Link to comment https://forums.phpfreaks.com/topic/106293-search-the-line/ Share on other sites More sharing options...
beboo002 Posted May 19, 2008 Share Posted May 19, 2008 use strstr() Link to comment https://forums.phpfreaks.com/topic/106293-search-the-line/#findComment-544724 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 Will it echo the whole line if it finds it? Then just use strpos(), it's faster. Link to comment https://forums.phpfreaks.com/topic/106293-search-the-line/#findComment-544726 Share on other sites More sharing options...
joshblue Posted May 19, 2008 Author Share Posted May 19, 2008 Will it echo the whole line if it finds it? Then just use strpos(), it's faster. Yeah, it should output the whole line if ever it finds that particular string.. Link to comment https://forums.phpfreaks.com/topic/106293-search-the-line/#findComment-544732 Share on other sites More sharing options...
joshblue Posted May 19, 2008 Author Share Posted May 19, 2008 Will it echo the whole line if it finds it? Then just use strpos(), it's faster. Got that. but if ever I'll be looking for more than one string? Link to comment https://forums.phpfreaks.com/topic/106293-search-the-line/#findComment-544743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.