Jump to content

Need Help on Preg Match


skenny

Recommended Posts

Ok I have a code but there are some things i need to add to it but i don't know what

Here is what i want to do

 

1.Remove Duplicates from the array

2.Remove Items from the array that have the word "directory" in it

 

Here is the code

preg_match_all($pattern, $contents, $results, PREG_PATTERN_ORDER);
$results = $results[1];
$results = implode("SPLIT",$results);
$results = "SPLIT".$results;
$results = str_replace("SPLIT/","SPLIT"."/",$results);
$results = explode("SPLIT", $results);
array_shift($results);
foreach ($results as $t ) { 
print ('<a href="'. $t .'">' . $t . '</a><br>'); 
} 

 

It doesn't have to remove the duplicates or the items with the word "directory"

I just don't want these items to PRINT

 

Any help is greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/164726-need-help-on-preg-match/
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.