Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

PHP/Regex: Make all cid 4

Using PHP and REGEX, I want to make the value for "cid" to be 4 when the first part is "action=orders&task=order&cid="

<?php

echo make_id_4('

Hello World.

action=orders&task=order&cid=0
action=orders&task=order&cid=1
action=orders&task=order&cid=3
action=orders&task=order&cid=10

Blah blah blah

action=orders&task=order&cid=999
action=orders&task=order&cid=9999


');


function make_id_4 ($str) {
return $str;
}



?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rok-Kralj
Rok-Kralj
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial