open-southeners/extended-php
Extended PHP helpers for modern apps: adds convenient functions, utilities, and small enhancements that complement core PHP to reduce boilerplate and speed up everyday development. Lightweight, easy to drop into existing projects.
{% 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) which works similarly.
{% endhint %}
Check if a variable is a valid json string.
$json = '{}';
\OpenSoutheners\ExtendedPhp\Strings\is_json($json); // true
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 [):
$json = '1';
\OpenSoutheners\ExtendedPhp\Strings\is_json_structure($json); // false
Get domain part from email address:
$email = 'hello@mydomain.com';
\OpenSoutheners\ExtendedPhp\Strings\get_email_domain($email); // 'mydomain.com'
How can I help you explore Laravel packages today?