Header menu

_________________________________________________________________________________

Thursday 5 September 2013

Find position of string in a given string

Strpos Function


<html>
<body>
    <?php
        $str1="test";
        $str2="This is a testing string ";
        $pos=strpos($str2,$str1);
        echo "Given String : ".$str2."</br>";
        echo "String to be matched : ".$str1."</br>";
        echo "Match found at position : ".$pos;
        ?>
    </body>
</html>

No comments:

Post a Comment