bfg / text
All sorts of chips to work with the text
Installs: 23 650
Dependents: 4
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:bfg-app
Requires
- php: >=8.0.0
- bfg/object: ^0.0.4
Requires (Dev)
- mockery/mockery: ^1.3.1
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-12-22 18:26:18 UTC
README
Helpers
is_json
Checks whether the row is Json object.
is_json(json_encode(['test' => true])); // true
lang_in_text
Applies special triggers of language variables.
lang_in_text("Text: @validation.accepted"); // Text: The :attribute must be accepted.
tag_replace
Invested tag replacement on the object values or array.
tag_replace("Hello, {user.name} {user.lastname}. You phone: {phone}", [ 'user' => ['name' => 'Ivan', 'lastname' => 'Petrov'], 'phone' => '123456789' ]); // Hello, Ivan Petrov. You phone: 123456789
file_lines_get_contents
Get data from file by lines.
file_lines_get_contents('LICENSE.md', 3, 3); //Copyright (c) 2021 BFG <bfg.script@gmail.com>