Jump to content

Searching variable for { }


PHPTOM

Recommended Posts

$subject = "whatever you are searching";

 

// this will find all of the items and put into $matches array
preg_match_all('~\{([^\}]+)\}~',$subject,$matches);

// alternatively, this will find the items and replace them with something
$subject = preg_replace('~\{([^\}]+)\}~','replacement here',$string);

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.