I load and run a cycle through my XML structure:
- $xml = simplexml_load_file(flakk);
- foreach ($xml->class as $class)
- {
- now how to delete $class ???
- }
the unset($class)
has no effect.
I load and run a cycle through my XML structure:
- $xml = simplexml_load_file(flakk);
- foreach ($xml->class as $class)
- {
- now how to delete $class ???
- }
the unset($class)
has no effect.
收起
You cant remove foreach element, but can for example so
for($i=count($xml->class); $i--; ) unset($xml->class[$i]);
Or
for($i=count($xml->class); $i--; )
if ($xml->class[$i] == AnyValue)
unset($xml->class[$i]);
报告相同问题?