Empty XML node and how to handle
-
Hello,
I have a XML file that has empty stock in some products, like this:
<stock/>
I have alredy written a PHP function in order to manage the stock of the products.. Thus, how to handle this <stock/> value? Nothing seems to be working.. For example, I have already wrote this:
function manage_stock($stock_qty) {
if(!isset($stock_qty) || $stock_qty === “” || empty($stock_qty) || is_null($stock_qty)) {
return 10;
}
}
But the IF statement does not seem to work! How to check the values of these XML elements? Thanks in advance
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.