Jump to content

Help me to compare two string.


vcivilen

Recommended Posts

I have two arrays:

$arr1 = {1,2,3,4,5,6,7,8}

$arr2 = {0,3,9,10,12,14,16}

How can I find the same value between them and return the ouput array:

$outputarr = {3,9}

-----------

Other problems:

Two string

$str1 = "1,2,3,4,5,6,7,8";

$str2 = "0,3,9,10,12,14,16";

how can I get

$stroutput = "3,9";

------------

I think can be use "for" or "while..do.."... but is there any quicker method ?

Link to comment
https://forums.phpfreaks.com/topic/95434-help-me-to-compare-two-string/
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.