$file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_8.xml' ); $xml = new SimpleXMLElement( $file ); foreach ($xml->xpath('//item/*[ not( name() = "g:id" or name() = "g:title" ) ]') as $child) unset($child[0]); $label_name = 'g:custom_label_0'; for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ ) { $xml -> channel -> item[$i] -> $label_name = 'pilki-do-kosza'; } $xml -> asXml( 'pilki-do-kosza.xml' ); echo '
wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-do-kosza.xml
'; $file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_9.xml' ); $xml = new SimpleXMLElement( $file ); foreach ($xml->xpath('//item/*[ not( name() = "g:id" or name() = "g:title" ) ]') as $child) unset($child[0]); $label_name = 'g:custom_label_0'; for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ ) { $xml -> channel -> item[$i] -> $label_name = 'pilki-lekarskie'; } $xml -> asXml( 'pilki-lekarskie.xml' ); echo 'wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-lekarskie.xml
'; $file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_10.xml' ); $xml = new SimpleXMLElement( $file ); foreach ($xml->xpath('//item/*[ not( name() = "g:id" or name() = "g:title" ) ]') as $child) unset($child[0]); $label_name = 'g:custom_label_0'; for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ ) { $xml -> channel -> item[$i] -> $label_name = 'pilki-nozne'; } $xml -> asXml( 'pilki-nozne.xml' ); echo 'wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-nozne.xml
'; $file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_11.xml' ); $xml = new SimpleXMLElement( $file ); foreach ($xml->xpath('//item/*[ not( name() = "g:id" or name() = "g:title" ) ]') as $child) unset($child[0]); $label_name = 'g:custom_label_0'; for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ ) { $xml -> channel -> item[$i] -> $label_name = 'pilki-reczne'; } $xml -> asXml( 'pilki-reczne.xml' ); echo 'wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-reczne.xml
'; $file = file_get_contents( 'https://kalsport.pl/modules/xmlfeeds/xml_files/feed_12.xml' ); $xml = new SimpleXMLElement( $file ); foreach ($xml->xpath('//item/*[ not( name() = "g:id" or name() = "g:title" ) ]') as $child) unset($child[0]); $label_name = 'g:custom_label_0'; for ( $i = 0; $i < count( $xml -> channel -> item ); $i++ ) { $xml -> channel -> item[$i] -> $label_name = 'pilki-siatkowe'; } $xml -> asXml( 'pilki-siatkowe.xml' ); echo 'wygenerowano https://cdn.projectpro.pl/kalsport-pl/pilki-siatkowe.xml
';