Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-13-2009, 01:24 PM   #1
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Post php array... can I have more than two values per entry?

Hi all,

I created a class which has to return an array.

My problem is I need to return 3 entries per record for example:
array( "2009-06-13", "John", "Doe";
       "2009-06-13", "Paul", "Simon";
       "2009-06-12", "Frank", "Herbert";
Can this be done? What is the syntax? Where is the documentation?

If this can't be done, How would you return this to a class without using a DB?

Many thanks!
Old 06-13-2009, 03:43 PM   #2
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,118

Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972

PHP Code:
function foo (){
$result=array( array("2009-06-13""John""Doe"),
                 array (
                 array (

The documentation is on


Last edited by jlinkels; 06-13-2009 at 03:48 PM.
Old 06-13-2009, 08:20 PM   #3
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
or since you are using classes already you can create a class that holds the three values in question and the array elements will be instances of the class.
Old 06-15-2009, 04:51 PM   #4
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Original Poster
Rep: Reputation: 48
Thanks guys sorry for the late answer!

I like the idea of the Class but I'll get to that a little further down the line of my newb education


array, php

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to input values from *.txt to an array in C++ HBMSGUY Programming 6 11-18-2008 09:33 PM
Java - Assigning Array Values en masse indienick Programming 11 08-23-2006 12:28 PM
extracting values from an array bahadur Programming 2 08-14-2006 01:07 AM
Problem displaying Bash array values. shinobi59 Programming 3 01-17-2006 05:45 PM
How to return values into an array using awk Helene Programming 1 05-01-2004 10:05 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration