Re: [PHP] Function-return-array idea

2008-01-17 Thread Nathan Nobbe
On Jan 16, 2008 6:32 PM, Stijn Leenknegt [EMAIL PROTECTED] wrote: Hello I've an idea for PHP6. Let's kickoff with an example. ?php $info = getUserInformation($id); //return an array with all the information of an user. echo $info['naam']; ? This is nice, but when I want one element of

Re: [PHP] Function-return-array idea

2008-01-17 Thread Eric Butera
On Jan 16, 2008 6:32 PM, Stijn Leenknegt [EMAIL PROTECTED] wrote: Hello I've an idea for PHP6. Let's kickoff with an example. ?php $info = getUserInformation($id); //return an array with all the information of an user. echo $info['naam']; ? This is nice, but when I want one element of

Re: [PHP] Function-return-array idea

2008-01-17 Thread Jim Lucas
Jim Lucas wrote: I think this would be an easier/quicker fix for you then requesting that the PHP developers re-write a large portion of the way PHP currently works. Here is the reference that I have been looking for. http://en.wikipedia.org/wiki/Message_passing Jim -- PHP General Mailing

[PHP] Function-return-array idea

2008-01-16 Thread Stijn Leenknegt
Hello I've an idea for PHP6. Let's kickoff with an example. ?php $info = getUserInformation($id); //return an array with all the information of an user. echo $info['naam']; ? This is nice, but when I want one element of the returned array, I have to store the returned array into a variable and

Re: [PHP] Function-return-array idea

2008-01-16 Thread Richard Lynch
On Wed, January 16, 2008 5:32 pm, Stijn Leenknegt wrote: I've an idea for PHP6. Let's kickoff with an example. This belongs on php-internals... ?php echo getUserInformation($id)['naam']; ? where it has already been discussed at length, and, as I recall, rejected as too obfuscated for the

Re: [PHP] Function-return-array idea

2008-01-16 Thread Jim Lucas
I think this would be an easier/quicker fix for you then requesting that the PHP developers re-write a large portion of the way PHP currently works. ?php function i($arr, $i) { return $arr[$i]; } echo i(getUserInformation($id), 'naam'); #or echo i($object-fetchObjects(), 0)-method();

Re: [PHP] Function-return-array idea

2008-01-16 Thread Per Jessen
Stijn Leenknegt wrote: This is nice, but when I want one element of the returned array, I have to store the returned array into a variable and then call the variable. The next code example is my idea. ?php echo getUserInformation($id)['naam']; ? Let's look further then this small

[PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
Hi, I just wanted to know if it is wrong, or non-standard, for me to set-up functions that just return an array... example: function vert_links_array(): function vert_links_array() { return array( '1' = array(S_MANCOM,'start.php?page=productsamp;

Re: [PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
On Mar 21, 2006, at 2:35 PM, Michael Hulse wrote: Any suggestions? I am a self-taught php dude, so please don't laugh if this is a silly question. You know, the more I think about, the more I think I need to learn about PHP classes... Seems like I would just be able to define the array from

Re: [PHP] Function-returning array { OR } declare array at top of functions file?

2006-03-21 Thread Michael Hulse
On Mar 21, 2006, at 3:48 PM, Michael Hulse wrote: ... any good links for learning more about classes? This seems like a good tutorial to start with: http://www.phpfreaks.com/tutorials/48/0.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] function returning array

2003-09-07 Thread Leonie
How do I get a function to return an array? This code doesn't work: function getData() { function builds the array $theArray - tested ok return $theArray; } Any help on the syntax would be appreciated. Cheers Leonie -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] function returning array

2003-09-07 Thread Tom Rogers
Hi, Monday, September 8, 2003, 11:54:10 AM, you wrote: L How do I get a function to return an array? This code doesn't work: L function getData() { L function builds the array $theArray - tested ok L return $theArray; L } L Any help on the syntax would be appreciated. L Cheers L

Re: [PHP] function returning array

2003-09-07 Thread Leonie
Nothing. But it I run: function getData() { etc.. print_r ($theArray); return $theArray; } the data is definitely there. I should add that the function is within a class so it is like this: class excel_com { (all tested - it works well) function getData() { etc..

Re[2]: [PHP] function returning array

2003-09-07 Thread Tom Rogers
Hi, Monday, September 8, 2003, 12:16:47 PM, you wrote: L Nothing. But it I run: L function getData() { L etc.. L print_r ($theArray); L return $theArray; L } L the data is definitely there. L I should add that the function is within a class so it is like this: L class excel_com {

Re: [PHP] function returning array

2003-09-07 Thread Larry E . Ullman
Nothing. But it I run: function getData() { etc.. print_r ($theArray); return $theArray; } the data is definitely there. I think the example in the PHP manual goes something like... function getData () { // blah, blah return array ('value1', 'value2', ...); } Then you would call it

Re: [PHP] function for $array

2003-03-21 Thread Marek Kilimajer
I would use foreach instead of for, your function does not guarantie checking all elements and also checks elements that might not have been set. pei_world wrote: I want to use the following function the test the array elements, if all element is number return true, otherwise false; but the

[PHP] function for $array

2003-03-20 Thread pei_world
I want to use the following function the test the array elements, if all element is number return true, otherwise false; but the command marked, it print out only the first char of every strings in the array; can help? ie: ++0++ for 0.234 function check_int_float($array){ $result=true;

Fw: [PHP] function for $array

2003-03-20 Thread Kevin Stone
- Original Message - From: pei_world [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:30 PM Subject: [PHP] function for $array I want to use the following function the test the array elements, if all element is number return true, otherwise false