|
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 |
patrmich Smarty Rookie
Joined: 13 Nov 2012 Posts: 7
|
Posted: Sun Nov 08, 2015 10:28 am Post subject: How to get part of a variable located after a delimiter |
|
|
Hi,
In a template file (from Prestashop), I have the following variable
$Essai->Test
The variable takes this kind of value :
string1-string2
where - is a delimiter
How could I get the value of string1 or string2 ?
(I am not a programmer)
Thnak you in advance for any reply.
Patrick |
|
Back to top |
|
walruslives424 Smarty n00b
Joined: 19 Jul 2016 Posts: 1
|
Posted: Tue Jul 19, 2016 7:07 am Post subject: |
|
|
I also need this. minimalist wordpress themes
Last edited by walruslives424 on Fri Sep 23, 2016 12:40 pm; edited 2 times in total |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Tue Jul 19, 2016 7:29 pm Post subject: |
|
|
Have you tried to use an explode()?
Code: | {$val = explode('-', $Essai->Test)} |
After that this should work
Code: | {$val[0]}
{$val[1]} |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jul 19, 2016 8:44 pm Post subject: |
|
|
You're talking to a spamer-necroposter. |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Tue Jul 19, 2016 8:55 pm Post subject: |
|
|
|
|
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
|