Comunitatea PHP Romania
 

 
spacify

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-17. spacify

<?php

$smarty
->assign('articleTitle''Something Went Wrong in Jet Crash, Experts Say.');

?>

Where template is:

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

Will 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.

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
acasa , in pat
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Mobile Phones | Loans | Mortgages | Loans | Mobile Phones with free Nintendo Wii
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis