> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/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/oss/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'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.opensoutheners.com/oss/extended-php/strings-helpers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
