bfg/text

All sorts of chips to work with the text

Maintainers

👁 bfg

Package info

github.com/bfg-s/text

Type:bfg-app

pkg:composer/bfg/text

Statistics

Installs: 61 240

Dependents: 4

Suggesters: 0

Stars: 1

Open Issues: 0

0.0.4 2023-05-22 14:55 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 7b64c5cb072066f75b4b330067e81637285acb94

  • bfg

textextensionlaravel

This package is auto-updated.

Last update: 2026-06-22 21:49:06 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>