I need to get an array of nicknames. The fact is that all the data is displayed perfectly, but when a string is divided into an array $vivod = preg_split("/[?[][\w]{1,2}]/", $vivod); it turns out the nonsense just goes instead of each array array, I need to transfer this list to an array for further grabbing for each of them ... something like $length = count($vivod); for ($i = 0; $i < $length; $i++) { $length = count($vivod); for ($i = 0; $i < $length; $i++) { how to do it correctly that not everything in the line would go like it gives me, but each separately ...
<?php require_once 'simple_html_dom.php'; $data = file_get_html('http://w2.dwar.ru/instance_stat.php?outside=1&instance_id=131374891&finish=0'); if($data->innertext!='' and count($data->find('a'))){ foreach($data->find('a') as $a){ $vivod = $a->plaintext; $vivod = $vivod . ''; echo $vivod[1] . ''; } } ?> With normal grabbing, the list goes to one-line nicknames ... like this
<?php require_once 'simple_html_dom.php'; $data = file_get_html('http://w2.dwar.ru/instance_stat.php?outside=1&instance_id=131374891&finish=0'); if($data->innertext!='' and count($data->find('a'))){ foreach($data->find('a') as $a){ $vivod = $a->plaintext; $vivod = $vivod . ''; echo $vivod . ''; } } ?> Is it possible to simplify such a grabbing? What would be faster or load well, or at least the place did not take so much?
// КЛАН $clan = file_get_contents($url); if (strpos($clan, 'images/data/clans/')){ $pos = strpos($clan, 'images/data/clans/'); $clan = substr($clan, $pos); $pos = strpos($clan, '.gif" width="13" height="13" border="0" alt="" align="absmiddle">'); $clan = substr($clan, 0, $pos); $clan = str_replace('images/data/clans/','', $clan); $sclan = $clan; } else { $sclan = ''; } /* Выполняем запрос. Если нез клана не выводить его. */ if ($sclan) { $clanicus = '<img src="http://w2.dwar.ru/images/data/clans/'.$sclan.'.gif" border="0" alt="" />'; } else { $clanicus = ''; }
-CroCop- [4]dok3 (ФЭО-Прайм) [4]Бубльдубль (ФЭО-Прайм) [4]trying to grab the nicknames ... in the array that everyone was separately ... from each other) - Constantineprint $vivod.'<br />';then instead of one'<br />'somewhere two or three comes out, and when closing the bracket}nothing is left ... - Constantine