Perfect solution.
Thanks, I don't know how I overlooked the preg_replace_callback
function. That's exactly what I needed.
Thaddeus
CPT John W. Holmes wrote:
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]>
I'm looking to replace the 'nth' instance of an expression within a
string.
Example (v
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]>
> I'm looking to replace the 'nth' instance of an expression within a
string.
>
> Example (very simple)-
>
> $string="My mom can beat up your mom and your mom's dog";
> $pattern="mom";
> $replacement="dad";
>
> I want to be able to replace any particu
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]>
> I'm looking to replace the 'nth' instance of an expression within a
string.
>
> Example (very simple)-
>
> $string="My mom can beat up your mom and your mom's dog";
> $pattern="mom";
> $replacement="dad";
>
> I want to be able to replace any parti
I'm looking to replace the 'nth' instance of an expression within a string.
Example (very simple)-
$string="My mom can beat up your mom and your mom's dog";
$pattern="mom";
$replacement="dad";
I want to be able to replace any particular instance of the pattern
within that string. I was getting
I'm looking to replace the 'nth' instance of an expression within a string.
Example (very simple)-
$string="My mom can beat up your mom and your mom's dog";
$pattern="mom";
$replacement="dad";
I want to be able to replace any particular instance of the pattern
within that string. I was getting
5 matches
Mail list logo