Created
March 19, 2011 13:09
-
-
Save orther/877469 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$find_me = 'fds'; | |
$s1 = 'asd fds gfd hg'; | |
$s2 = 'yj5 werg 3g rth'; | |
$a1 = explode(' ', $s1); | |
$a2 = explode(' ', $s2); | |
$token = array_search($find_me, $a1); | |
if ($token !== FALSE) { | |
echo 'Ahhhh yeah mother fucker! The token is '.$token.' and the value for that token in string 2 is: '.$a2[$token]."\n"; | |
} else { | |
echo $find_me.' was not found in string 1.'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment