aliento Posted February 27, 2009 Share Posted February 27, 2009 Hi, I have to copy an xml file only if it contains data is there any way to know. More details ... The data i have to load comes from a file something.php?version=12 the next version is something.php?version=13 how can i know if the 13 version has been published? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/147146-solved-php-and-xml/ Share on other sites More sharing options...
MadTechie Posted February 27, 2009 Share Posted February 27, 2009 open it and then validate it Something like <?php $data = get_file_contents("something.php?version=12"); if (preg_match('/^<\?xml/sim', $data)) { # file starts with <?xml } ?> Quote Link to comment https://forums.phpfreaks.com/topic/147146-solved-php-and-xml/#findComment-772460 Share on other sites More sharing options...
aliento Posted February 27, 2009 Author Share Posted February 27, 2009 THHAAANNKKKKSSSSSSS Quote Link to comment https://forums.phpfreaks.com/topic/147146-solved-php-and-xml/#findComment-772475 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.