Get list of {} templates from String [PHP]

victorspider

New Member
I want to get the template words in a string. Template in the sense of words in {} inside a string. I am adding here a code to explain what I want exactly.\[code\]$string = "Hi {username}, Here is your {password}";function get_template_variables($string){ .... .... return array();}$result = get_template_variables($string);print_r($result);array[ 0 => username, 1 => password ]\[/code\]I hope you understand what I need. I need the definition program to be used inside the \[code\]get_template_variables($string)\[/code\] method
 
Back
Top