Jump to content

Search string in array


Panjabel

Recommended Posts

<?php 
$list1 = array("cv1","cv2","cv3"); 
$list2 = array("cv1s","cv2","cv3d"); 
foreach($list1 as $list) 
{ 
//if $list exists in array $list2 i want to print it, else not to print it 
} 
?> 

I've searched for this but i found, if i'm searching for "cv1" in "cv1" it finds it but if i'm searching for "cv1" in "cv1s" it doesn't

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/125921-search-string-in-array/
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.