The problem is that the file you are downloading uses namespacing when a standard MS Excel file doesn't.
e.g (standard MS Excel file)
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<workbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xml:space="preserve">
<fileVersion rupBuild="4505" lowestEdited="4" lastEdited="4" appName="xl"/>
<workbookPr codeName="ThisWorkbook"/>
<bookViews>
<workbookView visibility="visible" tabRatio="600" showVerticalScroll="1" showSheetTabs="1" showHorizontalScroll="1" minimized="0" firstSheet="0" autoFilterDateGrouping="1" activeTab="0"/>
</bookViews>
<sheets>
<sheet r:id="rId4" sheetId="1" name="Simple"/>
</sheets>
<definedNames/>
<calcPr fullCalcOnLoad="0" calcMode="auto" calcId="124519"/>
</workbook>
Your file:
<?xml version="1.0" encoding="UTF-8"?>
<x:workbook xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:bookViews>
<x:workbookView/>
</x:bookViews>
<x:sheets>
<x:sheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="R87019d29e03f45b0" sheetId="1" name="دیده بان بازار"/>
</x:sheets>
</x:workbook>
Note the x:
prefix for each element; the line xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
defines a namespace of x
for http://schemas.openxmlformats.org/spreadsheetml/2006/main
while in the standard MS Excel file this is simply xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
to set http://schemas.openxmlformats.org/spreadsheetml/2006/main
as the default namespace for the file
There is no clean and easy solution to this
A dirty solution is to modify the Excel2007 Reader. Assuming that you're using PHPExcel 1.8.0
Change line 505 from
$xmlStyles = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$xpath[Target]"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
to
$xmlStyles = simplexml_load_string(preg_replace('/\bx:/','',$this->_getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
Change line 609 from
$xmlWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
to
$xmlWorkbook = simplexml_load_string(preg_replace('/\bx:/','',$this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
Change line 652 from
$xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
to
$xmlSheet = simplexml_load_string(preg_replace('/\bx:/','',$this->_getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
Note that this is a hack, not a fix... it may have adverse effects on other workbooks (though I hope that it won't)
if($cell == 'test'){
is doing.... $cell is a PHPExcel_Cell object, not a string... should this beif($cell->getValue() == 'test'){
... but I can't find any cells in your linked spreadsheet that contain the text 'test'