Skip to content

Convert text variable to system variable

Notifications You must be signed in to change notification settings

Tomirad/ConvertStrings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ConvertStrings

Class to convert string variable to variable with attributes.

Two examples:

$convert = new \Treto\ConvertStrings();
$string = "My name is __userName__ and I have __userYear__ yr. Text created in [class] class.";
$string2 = $convert -> interpolate($string, ['userName' => 'Tomirad', 'userYear' => 33], '____');
echo $convert -> interpolate($string2, ['class' => 'ConvertStrings']);
#
# Result:
# My name is Tomirad and I have 33 yr. Text created in ConvertStrings class.
#

TODO:

  • Prepare class under Composer

About

Convert text variable to system variable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages