function anchor($text)
{
return preg_replace('#\>\>([0-9]+)#','<span class=anchor><a href="#$1">>>$1</a></span>', $text);
}
This piece of code is used to render page anchor.
I need to use the
([0-9]+)
part as a variable to do some maths to define the exact url for the href tag.
Thanks.
Use preg_replace_callback instead.
In php 5.3 +:
In php <5.3 :