PHP code example of bfg / text

1. Go to this page and download the library: Download bfg/text library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bfg / text example snippets


is_json(json_encode(['test' => true])); 
// true

lang_in_text("Text: @validation.accepted"); 
// Text: The :attribute must be accepted.

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('LICENSE.md', 3, 3); 
//Copyright (c) 2021 BFG <[email protected]>