Having trouble calling from simple arrays.

Discussion in 'PHP' started by tymlls05, Apr 24, 2009.

  1. #1
    I posted a script below that returns a blank page. I think i have enabled error reporting the correct way but returns nothing.

    Where am I go wrong? (If you are curious why the arrays are bunched together there is another script that is generating this php)

    <?
    
    error_reporting(E_ALL);
    
    $s_time    	= "2009/04/24 13:58:47";
    
    $server_name    = "Big Comp";
    
    $npc_count      = "16934";
    
    $item_count     = "77371";
    
    $guild_count    = "8";
    
    $client_count   = "6";
    
    $memory_usage   = "90548";
    
    $admin_email    = "tyler@aimelssmedia.com"; $online_name[]="Scorpion"; $online_account[]= "luisc23"; $online_name[]="Joavi"; $online_account[]= "nastradomas"; $online_name[]="Saga"; $online_account[]= "iori"; $online_name[]="Malakai"; $online_account[]= "malakai";
    
    
    
    
    foreach ($online_account as $v){
    echo $v;
    }
    foreach($online_name as $v) {
    echo $v
    }
    
     ?>
    PHP:
     
    tymlls05, Apr 24, 2009 IP
  2. JDevereux

    JDevereux Peon

    Messages:
    50
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    need semicolon after second echo $v, i reckon.
     
    JDevereux, Apr 24, 2009 IP
  3. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #3
    
    <?php
    
    $s_time = "2009/04/24 13:58:47";
    $server_name = "Big Comp";
    $npc_count = "16934";
    $item_count = "77371";
    $guild_count = "8";
    $client_count = "6";
    $memory_usage = "90548";
    
    $admin_email = "tyler@aimelssmedia.com";
    $online_name[] = "Scorpion";
    $online_account[] = "luisc23"; 
    $online_name[] = "Joavi"; 
    $online_account[] = "nastradomas"; 
    $online_name[] = "Saga"; 
    $online_account[] = "iori"; 
    $online_name[] = "Malakai"; 
    $online_account[]= "malakai";
    
    
    foreach ($online_account as $v) {
    	echo $v . " ";
    }
    echo "<br />";
    foreach ($online_name as $v) {
    	echo $v . " ";
    }
    
    ?>
    
    PHP:
     
    ActiveFrost, Apr 25, 2009 IP
  4. nayes84

    nayes84 Member

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    error_reporting(E_ALL); will have no effect if your code has a parsing error.
    it is better to change error_reporting through .htaccess file
     
    nayes84, Apr 25, 2009 IP