Tell me how to find the position of the first occurrence of a substring in a string?



Tell me how to find the position of the first occurrence of a substring in a string?..

Answer / Kumar Alok Ranjha

In PHP, you can use the `strpos()` function to find the position (index) of the first occurrence of a substring within another string. For example: `strpos($haystack, $needle);`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

tel me any 2 regular expressions with example

1 Answers   Wipro,


What is the correct and the most two common way to start and finish a php block of code?

1 Answers  


What are super global variables in php?

1 Answers  


What is binary safe string?

1 Answers  


Why is node js better than php?

1 Answers  


What the difference between the 'bitwise and' operator and the 'logical and' operator?

1 Answers  


Which functions are used to count the total number of array elements in php?

1 Answers  


How can we know that a session is started or not?

8 Answers  


Do I need to install php after xampp?

1 Answers  


How php statement is different from php script?

1 Answers  


Which function can be used to delete a file?

1 Answers  


How can you access a COM object from a PHP page?

1 Answers  


Categories