Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $str = 'a@gmail.com';
- $key = '11111';
- echo strpos($str, $key);
- exit;
- $str = 'a@gmail.com';
- $arr = array('11111' => 'test');
- foreach ($arr as $key => $val)
- {
- echo 'String: '.$str.'<br>';
- echo 'Key: '.$key.'<br>';
- echo 'Found at position: '.strpos($str, $key);
- }
- exit;
- String: a@gmail.com
- Key: 11111
- Found at position: 2
- $str = 'a@gmail.com';
- $arr = array('111' => 'test');
- foreach ($arr as $key => $val)
- {
- echo 'String: '.$str.'<br>';
- echo 'Key: '.$key.'<br>';
- echo 'Found at position: '.strpos($str, $key);
- }
- exit;
- String: a@gmail.com
- Key: 111
- Found at position: 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement