Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Array als ["a","b"] Ausgeben

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
SheppardX
Smarty n00b


Joined: 22 Sep 2015
Posts: 2

PostPosted: Tue Sep 22, 2015 10:24 am    Post subject: Array als ["a","b"] Ausgeben Reply with quote

Hey wie schon im Betreff steht möchte ich gerne ein übergebenes Array in folgender notation ausgeben ["a","b"] wie kann ich das machen ? übergeben bekomme ich
Array
(
[0] =>a
[1] =>b
[2] => c
[3] => d
)

LG
Back to top
View user's profile Send private message
ChrisFah
Smarty Pro


Joined: 02 Nov 2009
Posts: 158
Location: Traun, Austria

PostPosted: Mon Nov 09, 2015 5:45 pm    Post subject: Reply with quote

foreach($array as $x) {
$temp[] = '"'.$x.'"';
}
$result = implode(',', $temp);
Back to top
View user's profile Send private message
danbru1211
Smarty Rookie


Joined: 15 Jul 2014
Posts: 9
Location: Austria, Graz

PostPosted: Tue Nov 24, 2015 1:30 pm    Post subject: Reply with quote

Würde dir sonst noch
Code:
json_encode
empfehlen.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP