<?php $pattern = "/(い)(.)(.)(.)(.)(.)(.)(.)(.)(ぬ)/u"; $replacement = "\\1<span class='red'>\\2\\3\\4\\5\\6\\7\\8\\9</span>\\10"; $string = "いろはにほへとちりぬ"; echo preg_replace($pattern, $replacement, $string); ?>
You have javascript disabled. You will not be able to edit any code.