Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

template string php

You could also use strtr:

$template = '$who likes $what';

$vars = array(
  '$who' => 'tim',
  '$what' => 'kung pao',
);

echo strtr($template, $vars);
Outputs:

tim likes kung pao
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #template #string #php
ADD COMMENT
Topic
Name
8+6 =