FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » replacing spaces with newline
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
replacing spaces with newline [message #181307] Sat, 04 May 2013 11:09 Go to previous message
Simon Hall is currently offline  Simon Hall
Messages: 2
Registered: May 2013
Karma:
Junior Member
Hi Guys,

I am new to PHP and I am trying to clean up some text, what I am looking to do is to create a new line at each space, I have tried the following but it still outputs with just spaces.

<?php

$file = file_get_contents("mytext.txt");

$file = Str_replace(" ", "\r\n", $file);

echo $file;

?>

Any ideas?


Cheers


Simon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: take two - fetch items from a row.
Next Topic: Unique array of arrays - how can I do this?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 10:24:05 GMT 2024

Total time taken to generate the page: 0.03830 seconds