Re: Push an Array, Comma separated.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> My array:
> Array ( [0] => Demo2.txt [1] => Demo.txt [2] => Demo.txt )
>
> How could I push the values as:
>
> -> Demo2.txt, Demo.txt, Demo.txt?
>
> Not sure which approach is good.
>
> $saveFiles = array();
> array_push($saveFiles, $ufName);

you could use array_push(), or the shorter syntax:

 o array_push();

array_push($myArr, 'Demo2.txt', 'Demo.txt', 'Demo.txt');

 o Shorter syntax:

$myArr[] = 'Demo2.txt';
$myArr[] = 'Demo.txt';
$myArr[] = 'Demo.txt';

-- 
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux