View Single Post
Old 05-27-2009, 06:39 PM  
calmlikeabomb
Confirmed User
 
calmlikeabomb's Avatar
 
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
You owe me a blow job.

It could be shorter, but that takes time, more thought and money.

PHP Code:
<?php

$string 
'a,b,c,d';

foreach(
explode(','$string) as $match) {
    if(
in_array($match, array('a','c'))) $matches[] = $match;
}

print_r($matches); // Here are your items.

?>
__________________
subarus.

Last edited by calmlikeabomb; 05-27-2009 at 06:41 PM..
calmlikeabomb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote