Re: Walk though array applying my highlighting routine?
| From: | Burhan Khalid | Date: | Wed, 05 May 2004 09:59:50 +0000 |
| Subject: | Re: Walk though array applying my highlighting routine? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185407@lists.php.net to get a copy of this message | ||
Dave Carrera wrote:
Hi List, I have worked out how to highlight all search words in a string. I hope its useful to some one. Please make it better if you can so we can all share it. But what I want to know is how can I treat each string with this highlighting routine individually so that my output is each string highlighted where necessary like the single string code dose below. So I turn $string into an array by $string[] for each three lines and tackle each one separately and when all search words are highlighted for that string do the next then the next and end up with 3 strings with each word in the string highlighted.http://www.php.net/array_walk array_walk -- Apply a user function to every member of an array