So I have a text file with sets of 4 items I want to go in different arrays. I've tried the following but without success.
<?php
$urls="list.txt";
$page = join("",file("$urls"));
$kw = explode("|", $page);
$count = 0;
$links = array();
$images = array();
$widths = array();
$heights = array();
for($i=0;$i<count($kw);$i++){
$count++;
if ($count==1){
$links[$i] = array($kw[$i]);
}
if ($count==2){
$images[$i] = array($kw[$i]);
}
if ($count==3){
$widths[$i] = array($kw[$i]);
}
if ($count==4){
$heights[$i] = array($kw[$i]);
$count = 0;
}
}
?>
I'm not sure where my logic is wrong, but when I print the arrays out I dont get anything.
Thanks in advance.