← All built-ins / strchr()
strchr()
strchr(string $haystack, string $needle): string
Parameters
| Name | Type | Description |
|---|---|---|
| $haystack | string | string to search in |
| $needle | string | string to search for |
Return value
Alias of strstr().
Example
echo strchr("a/b/c.txt", "/");/b/c.txt