[ create a new paste ] login | about

Link: http://codepad.org/HtQ9mGeV    [ raw code | output | fork ]

PHP, pasted on May 8:
1
2
3
4
5
6
7
8
9
10
<?php

$longString = "I walk in the park.";
$stringArray = array("walk", "park", "beach");

foreach( $stringArray as $search) {
    if( !(strpos( $longString, $search) === false)) {
        echo $search;
    }
}


Output:
1
walkpark


Create a new paste based on this one


Comments: