I have those arrays , how to sort by string ? Just I need to sort mulltiple arrays I try sort() but no luck it give me error.
array(1) {
[0]=>
string(2) "10"
}
array(1) {
[0]=>
string(1) "2"
}
array(1) {
[0]=>
string(1) "3"
}
array(1) {
[0]=>
string(1) "4"
}
This is my code now
<?php
$myfiles = glob('articol/*');
foreach($myfiles as $filename){
if(is_file($filename)){
$file = file_get_contents($filename);
$html = $file;
preg_match('/<p class="id" hidden>(.*?)<\/p>/s', $html, $id) // Return 1 or 2 or 3 .... or 10 ;
$idFinal = array($id[1]);
sort($idFinal);
echo "<pre>"; var_dump($idFinal); echo "</pre>";
}
}
?>