|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Laangelinaj Smarty n00b
Joined: 23 Jan 2014 Posts: 1
|
Posted: Thu Jan 23, 2014 9:19 am Post subject: Counting digits for Phone number |
|
|
Hi, I'm a newbie in smarty
And i got problem with my smarty
I want to make a condition to get 1 phone number from the user either phone or phone2. And also i want to check whether it's 10 digits for every phone number. Then I want to add 0 in front of the phone number when the phone number just 9 digits.
My code below:
{if !isset($PHONE) && $PHONE2|substr:0:10==''}'0{$PHONE2}{else if !isset($PHONE)}'{$PHONE2}{else if isset($PHONE) && $PHONE != ''&& $PHONE|substr:0:10==''}'0{$PHONE}{else}'{$PHONE}{/if}
By the way, I'll put the code on CSV
Really thanks for the help before |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|