1. Go to this page and download the library: Download jlibs/php-string-max 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/ */
$result = StringMax::replaceTokensInArray([
'Hi {{name}}, remember to be {{tip}}.',
'Because {{myTarget}} love nice {{myTarget}}',
'and' => [
'the world is better if we have more {{mates}}.'
]
],
[
'name' => 'developer',
'tip' => 'nice',
'myTarget' => 'people',
'mates' => 'friends'
]
);
/*
Results:
$result = [
'Hi developer, remember to be nice.',
'Because people love nice friends',
'and' => [
'the world is better if we have more friends.'
]
]
*/
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.