godsent Posted March 20, 2009 Share Posted March 20, 2009 ok lets say $data looks like this $data = "one two three four five six seven"; they are away from each other within space " ". How could i search in $data to find for example word "two" Link to comment https://forums.phpfreaks.com/topic/150303-search-in-variable/ Share on other sites More sharing options...
kickstart Posted March 20, 2009 Share Posted March 20, 2009 Hi Use strpos. All the best Keith Link to comment https://forums.phpfreaks.com/topic/150303-search-in-variable/#findComment-789386 Share on other sites More sharing options...
phant0m Posted March 20, 2009 Share Posted March 20, 2009 With explode, you can split a string into an array, by specifying a delimiter(" ", in your case) <?php $results = explode(" ", $str); ?> Link to comment https://forums.phpfreaks.com/topic/150303-search-in-variable/#findComment-789389 Share on other sites More sharing options...
godsent Posted March 20, 2009 Author Share Posted March 20, 2009 yes i understand, ok problem solved Link to comment https://forums.phpfreaks.com/topic/150303-search-in-variable/#findComment-789394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.