RE: [PHP] I don't get arrays! HELP ME PLEASE!

From: Date: Wed, 22 Nov 2000 00:25:02 +0000
Subject: RE: [PHP] I don't get arrays! HELP ME PLEASE!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-26551@lists.php.net to get a copy of this message
Christian Dechery ... > ok... got it! > You know what my real problem is? Addiction to C and it's nasty thousands > of lines to do something simple. I suggest you a total brain-washing. Think for a moment in Visual C and visual Basic... How many lines of code do you need in VisualBasic to pop a error dialog? How many with VisualC? And remember, that damned website needs to be completely done by thursday... > Like, I didn't get REALLY what that command array() is for. What can u do > with it? Create and fill up a hash table? With what? For example, $friend[name]="john"; $friend[email]="john@domain.com"; does just the same as $friend=array( name => "john", email => "john@domain.com"); I consider easier the first way, but i wonder if the array() function is faster to be executed. Anyway, how cares how many CPU is wasted in that 1.1 Ghz webserver?? > for instance (I know I'm being a pain in the ass, just tell me when to stop > and I will)... > I created in pure C a pseudo-e-commerce system for my website. Since we > don't have databases (lack of cash) *ehem* Did you know that MySQL, a database format that PHP can deals very well with, is TOTALLY FREE?? > I did it all with binary files. It > works fine... perfect. Until your binary file grows up to several megabytes, and loading a page can spend 20 or 30 secs... > And I have a logfile so I can create stats. > It is in the format: > product_id|product_name|time|boolean type(can be 1 or 0, 1 for click, 0 for > view) > ok? > and I had to make a nice and cool log analyzer for the "clients" so they > can view how their products are going. > So I went there created structs, lists and tables in memory to store all > the shit I needed and then put it out on nice and kewl templates... and I > have NO idea how to build lists and tables on PHP... this array stuff isn't > really giving me what I need. Or it does, but I can't see it. All the > examples I've seen tells me nothing. What do you need? Show all the data in a array?? echo "<TABLE><TR><TD><B>Name</B></TD><TD><B>E-mail</B></TD></TR>"; while (list($name,$email)=each($friends)) { echo "<TR><TD>$name</TD>"; echo "<TD>$email</TD></TR>"; } echo "</TABLE>"; > and that is a low-to-medium complexity code, so I tought, if I could get > that "translated" to PHP, than I'd undestand those DAMNED arrays... you > know? I'm a pointer freak. Aaaarrrgghh!!! Stay away from me, you hellish creature!! > I don't see three or four varibles coming from > one function without pointers. Hahaha!! You'll get amazed when you see what the include() function does in PHP, believe me... You'll never though about functions returning several values through pointers... you'll think about subprograms copy-pasted into the main program that modify the values of the variables... Subject: Christian Dechery Brainwashing status: Starting... > sorry once again... I don't know anyone who programs in PHP, they all say: > "PHP? Humpf... ASP rules.", and getting started from a manual isn't easy at > all. Well, they'll be that guys that program under micro$oft... get a person that programs PHP under unix, they all hate ASP!

« previous php.general (#26551) next »