0

I want to get blog01.xml from data01.xml, blog02.xml from data02.xml and so on. I'm trying with the following code, but it doesn't work. What is wrong?

<?php
$v = 1;
do {

    $file = "RAW/" . 'data[$v].xml';
    $postxml = @file_get_contents($file);

    $postxml = str_replace("-", " ", $postxml);

    file_put_contents("XML/" . 'blog0[$v].xml', $postxml);
    $v++;
} while($v<=5);
?>
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116

1 Answers1

0

Use

file_put_contents('XML/blog0'.$v.'.xml', $postxml);
Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
parascus
  • 1,079
  • 1
  • 10
  • 14