Jump to content

preg_replace help


mike1313

Recommended Posts

I have a chat room. I need help with this.

 

$do_pm = preg_replace("|/pm *|", "", $decode);

 

I'm replacing what's after /pm.

 

Say /pm 45

 

is there anyway I can find out whats entered after 45? preferrrably by using preg_replace? or some other method.

 

Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/43782-preg_replace-help/
Share on other sites

I have a chat room. I need help with this.

 

$do_pm = preg_replace("|/pm *|", "", $decode);

 

I'm replacing what's after /pm.

 

Say /pm 45

 

is there anyway I can find out whats entered after 45? preferrrably by using preg_replace? or some other method.

 

Any help is appreciated.

<?
$filter=array( 
$bbcode = array(
"'|/pm(.*?)|'is" => "replace with",
"'|/pm(.*?)|'is" => "replace with",
"'|/pm(.*?)|'is" => "replace with",
);
$decode = preg_replace (array_keys($bbcode), array_values($bbcode), $decode);
?>

umm try something like that I didn't test it

Link to comment
https://forums.phpfreaks.com/topic/43782-preg_replace-help/#findComment-212570
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.