Jump to content


Photo

PHP Array


  • Please log in to reply
2 replies to this topic

#1 PHPrp

PHPrp
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 11 June 2006 - 08:26 PM

if($debug){
                        for($i=0;$i<sizeof($line);$i++){
                            echo ",line[$i]=".$line[$i];
                        }
                    }
                    if($line[1]=="HOL"){
                        $data_source=$line[5];
                        $tour_op=$line[6];
                        $depart_date=$line[7];
                        $depart_date_formatted=user_date_format($line[7]);
                        $dep_airport=$line[8];
                        $dest_airport=$line[9];
                        $dep_time=$line[10];
                        $arr_time=$line[11];
                        $arr_uk_date=$line[12];
                        $arr_uk_point=$line[13];
                        $nights=$line[14];
                        $flight_type=$line[15];
                        $adult_price=$line[16];
                        $child_price=$line[17];
                        $child_max_age=$line[18];
                        $availability=$line[19];
                        $rating=$line[20];
                        $arr_dest_time=$line[21];
                        $dep_dest_time=$line[22];
                        $flight_no_out=$line[23];
                        $flight_no_ret=$line[24];
                        $travel_code=$line[25];
                        $resort_code=$line[26];
                        $resort_name=$line[27];
                        
                        $hotel_name=$line[29];
                        $board_basis=$line[30];
                        $board_basis_text=$_SESSION["sess_board_basis_array"][$line[30]];
                        $holiday_code=$line[31];
                        $resort_features=$line[32];
                        $accom_features=$line[33];
                        $brochure_code=$line[34];
                        $brochure_page=$line[35];
                        $carrier_name=$line[36];
                        $product_name=$line[37];
                    }
                
Can anyone help me to understand what this part of the code doing. I undestood that this is a parof the array. HELP..

#2 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 12 June 2006 - 12:53 AM

[!--quoteo(post=382636:date=Jun 11 2006, 03:26 PM:name=PHPrp)--][div class=\'quotetop\']QUOTE(PHPrp @ Jun 11 2006, 03:26 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
if($debug){
                        for($i=0;$i<sizeof($line);$i++){
                            echo ",line[$i]=".$line[$i];
                        }
                    }
                    if($line[1]=="HOL"){
                        $data_source=$line[5];
                        $tour_op=$line[6];
                        $depart_date=$line[7];
                        $depart_date_formatted=user_date_format($line[7]);
                        $dep_airport=$line[8];
                        $dest_airport=$line[9];
                        $dep_time=$line[10];
                        $arr_time=$line[11];
                        $arr_uk_date=$line[12];
                        $arr_uk_point=$line[13];
                        $nights=$line[14];
                        $flight_type=$line[15];
                        $adult_price=$line[16];
                        $child_price=$line[17];
                        $child_max_age=$line[18];
                        $availability=$line[19];
                        $rating=$line[20];
                        $arr_dest_time=$line[21];
                        $dep_dest_time=$line[22];
                        $flight_no_out=$line[23];
                        $flight_no_ret=$line[24];
                        $travel_code=$line[25];
                        $resort_code=$line[26];
                        $resort_name=$line[27];
                        
                        $hotel_name=$line[29];
                        $board_basis=$line[30];
                        $board_basis_text=$_SESSION["sess_board_basis_array"][$line[30]];
                        $holiday_code=$line[31];
                        $resort_features=$line[32];
                        $accom_features=$line[33];
                        $brochure_code=$line[34];
                        $brochure_page=$line[35];
                        $carrier_name=$line[36];
                        $product_name=$line[37];
                    }
                
Can anyone help me to understand what this part of the code doing. I undestood that this is a parof the array. HELP..
[/quote]


looks like a form putting all the imput fields into an array! ......but thats just a guess

"Syntax error" .. WHERE THE **** IS IT?!

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 June 2006 - 01:18 AM

You will have to show us some lines before this chuck to really tell you what's going on. For instance where is the array $line coming from? To me, it looks like $line is coming from a database and this code is assigning each field to a variable. If that is the case, there are easier way's of doing this, but we really need to see more code.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users