Created
August 14, 2014 04:42
-
-
Save westonruter/e23856c7dec7d8aedf9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array(); | |
/* ... */ | |
$tpl_vars = array(); | |
foreach ( $data as $key => $value ) { | |
$tpl_vars[ '{{' . $key . '}}' ] = esc_attr( $value ); | |
} | |
$html = str_replace( | |
array_keys( $tpl_vars ), | |
array_values( $tpl_vars ), | |
$tpl | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment