I have this strange case, I hope you help me. I am trying to sort the result of an array Extracted with DOM
but it does not work for me
Code:
include('../simple_html_dom.php');
$html = file_get_html('http://Google.com/');
$links = array();
$orden= array_splice($links, 0,0,54) // utilizo esta función para ordenar los arrays y mostrar los últimos
foreach($html->find('a') as $a) {
$orden[] = $a->href;
}
print_r($orden);
RESUTADO
Array ([0] = >
1- link 1 2- link 2 3 - link 3 ............. (Show as 50 elements and I want to limit it to 5 for example)
1- link 1 2- link 2 3 - link 3 4- link 4 5- link 5
In summary array_splice
promises to do that but it does not work, what am I doing wrong?