Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 I need to figure out the best way to master doing arrays, should I get use to the first way or the second way<?php$myarray = array("west", "david", "mike", "jim", "bob", "dave", "walton", "korn", "siesmic");?>orthe longer waywith writing out each one below it.Which way is better while I am learning. Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted April 20, 2006 Share Posted April 20, 2006 What you want to use?The two ways have the same efect, but the first, is so clean and "fast".. so I use it.. the second way.. i use to random data, db reading, errors, ...[code]# first$var = array ( $a , $b , '1' , '2' );# second, mode one$var[] = $a;$var[] = $b;$var[] = '1';$var[] = '2';# second, mode twowhile ( !feof ($file) ){ $var[] = fget ($file);}[/code]You may chose by your needed.. ;)D.Soul Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Author Share Posted April 20, 2006 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.