mmm, I wonder if that str_replace even works?
you could also try writing the string in the same way you echo it instead of having the odd str_replace
$new_post_file = "1: ".$data['title']."<br>, 2: ".$data['imgSrc']."<br/>, 3: ".$data['uploadedBy']."<br/>, 4: ".$data['category']."<br/>, 5: ".$data['bildId'];
then do your echo this way
then you will actually be looking at what you are trying to write instead of writing one thing and echoing a different one.
if the strings