Code: Select all
<?php
$search = array(
'/(.*?)a(.*?)/',
'/(.*?)b(.*?)/',);
'/(.*?)c(.*?)/',);
'/(.*?)d(.*?)/',);
'/(.*?)e(.*?)/',);
'/(.*?)f(.*?)/',);
'/(.*?)g(.*?)/',);
$replace = array(
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter A">a</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter B">b</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter C">c</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter D">d</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter E">e</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter F">f</span>',
'<span style="cursor: help; border-bottom: 1px dotted #000;" title="This is the letter G">g</span>',);
echo preg_replace($search, $replace, $fetch['criteria_'.$what.'_list']); ?>Since 'abcdefg' returns 'ggggggggggggggggggggggggggggggggggggggggggg', there is something wrong with my regex.abcdefg
bcdefg
acdg
cge
ag
a
Anyone?