- 论坛徽章:
- 0
|
- <?php
- $text="软件大撒旦撒phpdasdsadassoft";
- $options = array ("软件","php","soft","p");
- foreach ($options as $key => $value) {
- if(eregi($value,$text)){
- $ather="<A onclick=\"tagshow(event, '$value')\" href=\"javascript:void(0);\" target=_self><STRONG>$value</STRONG></A>";
- //echo $ather;
- $text=str_replace($value,$ather,$text);
- }
- }
- echo $text;
- ?>
复制代码
- <A onclick="tagshow(event, '软件')" href="javascri<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>t:void(0);" target=_self><STRONG>软件</STRONG></A>大撒旦撒<A onclick="tagshow(event, '<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>h<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>')" href="javascri<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>t:void(0);" target=_self><STRONG><A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>h<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A></STRONG></A>dasdsadas<A onclick="tagshow(event, 'soft')" href="javascri<A onclick="tagshow(event, 'p')" href="javascript:void(0);" target=_self><STRONG>p</STRONG></A>t:void(0);" target=_self><STRONG>soft</STRONG></A>
复制代码
当php替换后执行到p 就把原来php的p也替换了 超级连接就乱套了
这个要怎么排除超级连接 不进行替换呢 |
|