template string php

Solutions on MaxInterview for template string php by the best coders in the world

showing results for - "template string php"
Maverick
22 Nov 2017
1You could also use strtr:
2
3$template = '$who likes $what';
4
5$vars = array(
6  '$who' => 'tim',
7  '$what' => 'kung pao',
8);
9
10echo strtr($template, $vars);
11Outputs:
12
13tim likes kung pao