3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array ( 0 => array ( 'id' => '19', 'Title_EN' => 'Australian Transaction Reports and Analysis Center (AUSTRAC)', 'Link_EN' => 'http://www.austrac.gov.au', 'Title_SP' => NULL, 'Link_SP' => 'http://www.austrac.gov.au', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 1 => array ( 'id' => '5', 'Title_EN' => 'Bank for International Settlements (BIS)', 'Link_EN' => 'http://www.bis.org', 'Title_SP' => 'Bank for International Settlements (BIS)', 'Link_SP' => 'http://www.bis.org', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 2 => array ( 'id' => '7', 'Title_EN' => 'Banking Control Commission of Lebanon', 'Link_EN' => 'http://www.bccl.gov.lb', 'Title_SP' => 'Banking Control Commission of Lebanon', 'Link_SP' => 'http://www.bccl.gov.lb', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 3 => array ( 'id' => '6', 'Title_EN' => 'Banque de France', 'Link_EN' => 'http://www.banque-france.fr', 'Title_SP' => 'Banque de France', 'Link_SP' => 'http://www.banque-france.fr', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 4 => array ( 'id' => '4', 'Title_EN' => 'Banque du Liban (BDL)', 'Link_EN' => 'http://www.bdl.gov.lb', 'Title_SP' => 'Banque du Liban (BDL) (arabic)', 'Link_SP' => 'http://www.bdl.gov.lb', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 5 => array ( 'id' => '18', 'Title_EN' => 'Cellule de Traitement des Informations Financières (CTIF)', 'Link_EN' => 'http://www.ctif-cfi.be', 'Title_SP' => NULL, 'Link_SP' => 'http://www.ctif-cfi.be', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 6 => array ( 'id' => '12', 'Title_EN' => 'Financial Action Task Force on Money Laundering (FATF)', 'Link_EN' => 'http://www.fatf-gafi.org', 'Title_SP' => NULL, 'Link_SP' => 'http://www.fatf-gafi.org', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 7 => array ( 'id' => '8', 'Title_EN' => 'Financial Crimes Enforcement Network (FinCEN)', 'Link_EN' => 'http://www.fincen.gov', 'Title_SP' => NULL, 'Link_SP' => 'http://www.fincen.gov', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), ); $icon1 = '<i class="fa-angle-left fa"></i>'; $icon2 = '<i class="fa-angle-right fa"></i>'; $count = 0; $lang = 'EN'; $HTML = ''; $totalcount = count($result); foreach ($result as $row) { $Title = $row['Title_'.$lang]; $Link = $row['Link_'.$lang]; if($count++ % 2 == 0) { $HTML .= '<div>'; $HTML .= ' <span class="side1"><a href="'.addhttp($Link).'" target="_blank">'.$icon1.' '.$Title.'</a></span> '; if($totalcount % 2 == 0 && $totalcount==$count) {$HTML .= '</div>';} } else { $HTML .= ' <span class="side2"><a href="'.addhttp($Link).'" target="_blank">'.$Title.' '.$icon2.'</a></span> '; $HTML .= '</div>'; } } echo $HTML; function addhttp($url) { if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { $url = "http://" . $url; } return $url; }

preferences:
50.24 ms | 402 KiB | 5 Q