Jump to content

[SOLVED] Matching


WorldDrknss

Recommended Posts

I need help matching a string similar to what is bellow:

 

|$INFO Some information$Some information$Some information$Some information$Some information$Some information$Some information$Some information$|

 

I have tried:

$parts = eregi("\|\$HubINFO [(.*)\$]{8}\|", $out, $matches);

but obviously this does not work.

Link to comment
https://forums.phpfreaks.com/topic/58269-solved-matching/
Share on other sites

Well, do you need to match only one line or many? anyways, to match one single line try this:

 


$myString='|$INFO Some information01$Some information02$Some information03$Some information04$Some information05$Some information06$Some information07$Some information08$|';
$myString=preg_split('/\|\$INFO\s*|\$|\|/',$myString,-1,PREG_SPLIT_NO_EMPTY);
echo '<pre>'.print_r($myString,true).'</pre>';

Link to comment
https://forums.phpfreaks.com/topic/58269-solved-matching/#findComment-288976
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.