mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-23 03:56:23 +00:00
20 lines
364 B
Markdown
20 lines
364 B
Markdown
|
---
|
||
|
id: 264796d2-49ae-42fc-9d9d-aeea84343ef1
|
||
|
title: str~startswith~()
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
Checks if string starts with other string. Opposite of
|
||
|
[str~endswith~()](20201113115452-str_ends_with). See RFC[^1].
|
||
|
|
||
|
# Syntax
|
||
|
|
||
|
``` php
|
||
|
str_starts_with('haystack', 'hay') // true
|
||
|
```
|
||
|
|
||
|
# Footnotes
|
||
|
|
||
|
[^1]: <https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions>
|