Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Get the juciest casino bonuses at this great website

If you are looking for great entertainment online, then we would like to recommend CasinoAdvisers.com. Find the best casino bonus available and much more that makes your casino experience much more enjoyable!

replace

Простой поиск и замена в переменной. Это эквивалент функции PHP str_replace().

Позиция параметра Тип Обязателен По умолчанию Описание
1 string Да n/a Строка текста, которую следует заменить.
2 string Yes n/a Строка текста, на которую следует заменить.

Example 5.15. replace


<?php

$smarty->assign('articleTitle', "Child's Stool Great for Use in Garden.");

?>

   

Шаблон:


{$articleTitle}
{$articleTitle|replace:'Garden':'Vineyard'}
{$articleTitle|replace:' ':'   '}

   

Результат обработки:


Child's Stool Great for Use in Garden.
Child's Stool Great for Use in Vineyard.
Child's   Stool   Great   for   Use   in   Garden.

   

См. также regex_replace и escape.

Comments
No comments for this page.

Advertisement