$line) {
$posted_array[$key] = $line;
// $priority[$key] = $line['priority'];
// echo '$posted_array['.$key.'] = '.$line;
// echo '$priority['.$key.'] = '.$line['priority'];
$words = explode("|", $line);
$each_posted_array = array();
foreach ($words as $key => $word) {
$word = trim($word);
$each_posted_array[$key] = $word;
if($key == 4)
{
if($each_posted_array[4] == 1)
{
$key_priority = 1;
}
elseif($each_posted_array[4] == 2)
{
$key_priority = 2;
}
elseif($each_posted_array[4] == 3)
{
$key_priority = 3;
}
else
{
$key_priority = 3;
}
} // if($key == 4)
////// echo '$each_posted_array[' . $key . '] = ' . $word;
// echo $word;
}
if( count($each_posted_array) == 7 )
{
if($key_priority == 1)
{
// echo "
word1 is: " . $word . "
";
$priority1 = array(0 => $each_posted_array[0],
1 => $each_posted_array[1],
2 => $each_posted_array[2],
3 => $each_posted_array[3],
4 => $each_posted_array[4],
5 => $each_posted_array[5],
6 => $each_posted_array[6]
);
// $array_merged = array_merge($each_posted_array, $priority1);
// array_push($priority1, $priority1_1);
// foreach ($array_merged as $key => $value) {
// echo '
array_merged $array_merged['.$key.'] = '.$value. "
";
// echo "
push_array(): " . $value . "
";
// }
for ($i=0; $i < 7; $i++) {
$priority1[$i] = $each_posted_array[$i];
// array_push($priority1, $each_posted_array[$i]);
// $priority3[$i] = $each_posted_array[$i];;
}
/*
$priority1[0] = $each_posted_array[0];
$priority1[1] = $each_posted_array[1];
$priority1[2] = $each_posted_array[2];
$priority1[3] = $each_posted_array[3];
$priority1[4] = $each_posted_array[4];
$priority1[5] = $each_posted_array[5];
$priority1[6] = $each_posted_array[6];
*/
}
elseif($key_priority == 2)
{
// echo "
word2 is: " . $word . "
";
$priority2[0] = $each_posted_array[0];
$priority2[1] = $each_posted_array[1];
$priority2[2] = $each_posted_array[2];
$priority2[3] = $each_posted_array[3];
$priority2[4] = $each_posted_array[4];
$priority2[5] = $each_posted_array[5];
$priority2[6] = $each_posted_array[6];
}
elseif($key_priority == 3)
{
// echo "
word3 is: " . $word . "
";
$priority3[0] = $each_posted_array[0];
$priority3[1] = $each_posted_array[1];
$priority3[2] = $each_posted_array[2];
$priority3[3] = $each_posted_array[3];
$priority3[4] = $each_posted_array[4];
$priority3[5] = $each_posted_array[5];
$priority3[6] = $each_posted_array[6];
}
else
{
for ($i=0; $i < 7; $i++) {
// array_push($priority3[$i], $each_posted_array[$i]);
// $priority3[$i] = $each_posted_array[$i];;
}
} // if($key_priority == 1)
?>
$line) { // outside foreach
/*
foreach ($priority1 as $key => $value) {
echo '
THERE $priority1['.$key.'] = '.$value. "
";
// echo "
push_array(): " . $value . "
";
}
*/
?>