I suspect it's not allowable
I am trying to filtering the data according to the user selection..
Here is the variable having the code changes dynamically according to the users input.
Sometimes the variable $p having the
$p="$line[10]=='MICRO'";
or
$p="$line[10]=='MICRO' || $line[10]=='NO'";
or
$p="$line[10]=='MBTS' || $line[10]=='MICRO' || $line[10]=='NO' || $line[10]=='ODM' && $line[9]=='HUBSITE' || $line[10]=='NO'";
Only the thing is the $p variable data is dynamically varies according to the users selections.
and the number inside the $line array is column number of the csv file.
what it does is displaying the list of the values in variable and these values has to print in the if condition
Here I am using the CSV file and in the csv file I am filtering the particualr columns using the above variable.
<?php
$circle_sheet="DETAILS.csv";
$f = fopen($circle_sheet, "r");
while (($line = fgetcsv($f)) !== false)
{
$p=eval($p);
if(${$p})
{
echo "<tr>";
foreach($line as $cell)
{
echo "<td style='color:white;'>" . htmlspecialchars($cell) . "</td>";
}echo "</tr>\n";
}
}
?>
In the above while loop the if condition is wrong , the $p variable data has to echo in if Block..
But I am getting the Parse error: syntax error, unexpected T_ECHO