Articles → PHP → strpos function in PHP

strpos function in PHP






Purpose





Example


<!DOCTYPE html>
<html>
	<body>
		<?php
echo "The position of first instance of had is at:".strpos("i had had my lunch","had");
?>
	</body>
</html>



Output


Picture showing the output of the strpos function in php

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, October 13, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250