PHP Manual

PEAR Manual

Smarty Manual

PostgreSQL

MySQL Manual

Perl Manual

spacify

spacify is a way to insert a space between every character of a variable. you can optionally pass a different character (or string) to insert.

parameter positiontyperequireddefaultdescription
1stringnoone spacethis what gets inserted between each character of the variable.

example 5-16. spacify

<?php

$smarty
->assign('articletitle''something went wrong in jet crash, experts say.');

?>

where template is:

{$articletitle} {$articletitle|spacify} {$articletitle|spacify:"^^"}

this should output:

something went wrong in jet crash, experts say. s o m e t h i n g   w .... snip ....  s h ,   e x p e r t s   s a y . s^^o^^m^^e^^t^^h^^i^^n^^g^^ .... snip .... ^^e^^r^^t^^s^^ ^^s^^a^^y^^.

see also wordwrap and nl2br.