Re: [PHP] newbie array question

2003-07-10 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Thu, 10 Jul 2003 at 15:30, lines prefixed by '>' were originally written by you. > If i have a valid sql query that returns three the records > 'john','jack' and 'mary' and i want to put that into an array where > array[0]->john,array[1]->jack

[PHP] newbie array question

2003-07-10 Thread bob pilly
Hi All Im new to php and are getting a bit confused about the sybase_fetch_array function (i think that this is the same as mysql_fetch_array?). If i have a valid sql query that returns three the records 'john','jack' and 'mary' and i want to put that into an array where array[0]->john,array[

Re: [PHP] newbie array question

2002-08-13 Thread Bas Jobsen
Op dinsdag 13 augustus 2002 20:50, schreef Alexander Ross: > If I have a string variable that is already of the form > ('item','item2','item3') [including the parens and quotes in the string], > is there an easy way to change that variable into an array?? > Array($var) doesn't work. Thanks --

Re: [PHP] newbie array question

2002-08-13 Thread Rasmus Lerdorf
Two ways I can think of off the top of my head: $s = "('item','item2','item3')"; preg_match_all("/'(.*?)'/",$s,$regs); $result = $regs[1]; or $s = "('item','item2','item3')"; eval('$result = array'.$s.';'); Neither is very efficient though. eval() is particularly ugly. -R

[PHP] newbie array question

2002-08-13 Thread Alexander Ross
If I have a string variable that is already of the form ('item','item2','item3') [including the parens and quotes in the string], is there an easy way to change that variable into an array?? Array($var) doesn't work. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] newbie array question

2001-03-12 Thread Robin Vickery
> "S" == "stas" <[EMAIL PROTECTED]> writes: > Thanks, I know that, but I don't want to type out assignments > manually, as my list of my form values will grow. However, I solved > very simply like this: > $form_val_list = >"firstname,lastname,address,address2,city,state,zip,phone,ema

Re: [PHP] newbie array question

2001-03-09 Thread stas
Thanks, I know that, but I don't want to type out assignments manually, as my list of my form values will grow. However, I solved very simply like this: $form_val_list = "firstname,lastname,address,address2,city,state,zip,phone,email,resume"; $form_arr = explode (",", $form_val_list); while (lis

RE: [PHP] newbie array question

2001-03-09 Thread Boget, Chris
> I am trying to create an associative array dynamically. > Here's what I did first: > $form_val_list = > "firstname,lastname,address,address2,city,state,zip,phone,emai > l,resume"; > $form_arr = explode (",", $form_val_list); > while (list ($key, $val) = each ($form_arr)) > { >ech

[PHP] newbie array question

2001-03-09 Thread stas
Hello, I am trying to create an associative array dynamically. Here's what I did first: $form_val_list = "firstname,lastname,address,address2,city,state,zip,phone,email,resume"; $form_arr = explode (",", $form_val_list); while (list ($key, $val) = each ($form_arr)) { echo "$key i