PHP: I get XML feed of 20 articles, I have pick 3 articles randomly and print xml out in the same format. Randomly picked article should change random every day not on every ref
How about just save your file with a date name and then check that date doesn't already exist
// Write our updated XML back to a new file
if( !file_exists( $date . '_feedout.xml' ) )
$doc->save( $date . '_feedout.xml' );
Or
// Write our updated XML back to a new file
if( date( "Y/m/d", filemtime( 'feedout.xml' ) ) != $date )
$doc->save( 'feedout.xml' );