note 77779 deleted from function.stripos by nlopess
| From: | nlopess@php.net | Date: | Wed, 12 Sep 2007 19:14:20 +0000 |
| Subject: | note 77779 deleted from function.stripos by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130436@lists.php.net to get a copy of this message | ||
Note Submitter: optout at gmail dot com
----
I am doing a highlight that slides to the right for each match.
Very sloppy code but you get the idea...
#GLOBAL
$i = 0;
LOOP(condition) {
$haystack = "AGAAAAAAAAAAAAAAAAAATGATAAAA";
$needle = "AAAA";
$start = stripos($haystack,$needle,$i);
$i = $start + 1;
$end = $start + strlen($needle);
$stop = strlen($haystack) - $end;
$before = substr($haystack, 0,$start);
$match = substr($haystack, $start,15);
$after = substr($haystack, $end, $stop);
echo "$before *****$match*****<$after";
}