PHP strpos() Function
Complete PHP String Reference
Definition and Usage
The strpos() function returns the position of the first occurrence of a
string inside another string.
If the string is not found, this function returns FALSE.
Syntax
|
strpos(string,find,start)
|
| Parameter |
Description |
| string |
Required. Specifies the string to search |
| find |
Required. Specifies the string to find |
| start |
Optional. Specifies where to begin the search |
Tips and Notes
Note: The strpos() function is case-sensitive.
Example
<?php
echo strpos("Hello world!","wo");
?>
|
The output of the code above will be:
Complete PHP String Reference

The Altova MissionKit is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy® - the industry-leading XML editor; MapForce® - a
graphical data mapping, conversion, and integration tool; StyleVision® - a visual XSLT stylesheet designer;
DiffDog® - an XML-aware diff/merge tool; and 2 additional tools.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|