Created
November 25, 2022 12:18
-
-
Save tivuno/fcc8fa18b47aa58f3bd4bf2d9c128711 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$xml = simplexml_load_file('arxeio1.xml'); | |
$filters = $xml->xpath('products/product/filter'); | |
foreach($filters as $filter) { | |
$feature_name = trim($filter->filter_name); | |
if ($feature_name == "ΙΣΧΥΣ/WATT") { | |
// Do something | |
echo "1<br />"; | |
} elseif ($feature_name == "LUMEN") { | |
// Do something else | |
echo "2<br />"; | |
} | |
} | |
$xml = simplexml_load_file('arxeio2.xml'); | |
$filters = $xml->xpath('products/product/attributes/attr'); | |
foreach($filters as $filter) { | |
$feature_name = trim($filter->name); | |
if ($feature_name == "Dimmable") { | |
// Do something | |
echo "3<br />"; | |
} elseif ($feature_name == "Αριθμός Λαμπτήρων") { | |
// Do something else | |
echo "4<br />"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment