Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 19th, 2006, 1:19 AM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 431
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
I could use some brainstorming

I'm simplifying the actual problem in the hopes that it will make the idea more efficient.
This is the array setup:
$foo[0] = 'something';
$bar[0][0] = 'something else';
$sna[0][0] = 'something more';
$bar[0][1] = 'another else';
$sna[0][1] = 'another more';
$foo[1] = 'more somethings';
$bar[1][0] = 'somethings elses';
$sna[1][0] = 'somethings mores';
...
The pattern continues like that of nth size and there must always be at least one $sna or $bar that starts with the same index as that of the $foo array.
So my question is how would I design a frontend HTML interface that would allow me to do the following:
  • change array positioning
  • modify array values
  • add more values to the arrays
Any ideas about the visual layout would be very helpful thank you.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Jan 21st, 2007, 11:12 AM   #2
Shaffer
Newbie
 
Join Date: Jan 2007
Posts: 2
Rep Power: 0 Shaffer is on a distinguished road
Arrays aren't dynamic enough for that.
You can't just add Array parameters.
Shaffer is offline   Reply With Quote
Old Jan 21st, 2007, 12:18 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Excuse me, Shaffer? Please don't post misleading information. PHP arrays are indeed dynamic.
<?php
$mainArray = array ();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Array Growth</title>
</head>
<body>
<?php
echo "mainArray<br/>";
print_r ($mainArray);
echo "<br/>";
$elemOne = array ("Element One");
$elemTwo = array ("Element Two");
$elemOne [] = "Element OneTwo";
$elemTwo [] = "Elent TwoTwo";
$mainArray [] = $elemOne;
$mainArray [] = $elemTwo;
echo "mainArray grown<br/>";
print_r ($mainArray);
echo "<br/>";
?>
</body>
</html>
Quote:
Originally Posted by Output
mainArray
Array ( )
mainArray grown
Array ( [0] => Array ( [0] => Element One [1] => Element OneTwo ) [1] => Array ( [0] => Element Two [1] => Elent TwoTwo ) )
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 21st, 2007, 8:13 PM   #4
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 431
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
I actually figured out a way to do it sorry that I hadn't replied to this thread but I'd forgotten that I actually started it when I got involved in the solution. Here's a pic to illustrate the idea.
Attached Images
File Type: jpg example.jpg (34.6 KB, 19 views)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC