> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/extended-php/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/extended-php/strings-helpers.md).

# Strings helpers

List of functions that works for PHP strings.

## is\_json

{% hint style="warning" %}
Since PHP 8.3+ this function will throw a deprecated warning message to move to PHP's native function instead ([`json_validate`](https://wiki.php.net/rfc/json_validate)) which works similarly.
{% endhint %}

Check if a variable is a valid json string.

```php
$json = '{}';

\OpenSoutheners\ExtendedPhp\Strings\is_json($json); // true
```

## is\_json\_structure

Similarly than `is_json` function but this one also checks if the data inside the string is also a valid JSON data structure (starting with `{` or `[`):

```php
$json = '1';

\OpenSoutheners\ExtendedPhp\Strings\is_json_structure($json); // false
```

## get\_email\_domain

Get domain part from email address:

```php
$email = 'hello@mydomain.com';

\OpenSoutheners\ExtendedPhp\Strings\get_email_domain($email); // 'mydomain.com'
```
