Script Maker

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Mon Dec 13, 2004 1:25 am    Post subject: Script Maker Reply with quote

http://trielite.afraid.org/graffiti.txt

I need someone to make me a script that will display that like this:
| ("shifted" \) means new line

I want it to look like a archieve of my grafiti wall:
http://trielite.afraid.org/chat.html

So like Hello|Hi|Bonjour would appear as:
Hello
Hi
Bonjour

Can anyone do this for me? It would be appreciated.
Back to top View user's profile Send private message ICQ Number
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Mon Dec 13, 2004 1:42 am    Post subject: Reply with quote

I would say use explode but thats only arrays. \n should work or <br>
_________________
int main() {
cout << "Im Pro Apache";
cin.get();
}
Back to top View user's profile Send private message Send e-mail
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Mon Dec 13, 2004 1:46 am    Post subject: Reply with quote

A what-idy what what?

I would like it better if someone could make a little code, and they can have credit in the code for it, oh, and it uses that http://trielite.afraid.org/graffiti.txt as the file to display.
Back to top View user's profile Send private message ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Dec 13, 2004 2:00 am    Post subject: Reply with quote

This code will brake up it , hopefully this is what you want done. Enjoy it!

Code:

<?php
$data = "graffiti.txt";
$file = file_get_contents($data);
$string = str_replace("|","<br>", $file);
echo $string;
?>


When it echo's , the | character will become the break tag and will seperate
it line by line since this is what your asking for , I think this will work. LateR!


Last edited by TRUSTAbyss on Mon Dec 13, 2004 2:16 am; edited 2 times in total
Back to top View user's profile Send private message Visit poster's website
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Mon Dec 13, 2004 2:02 am    Post subject: Reply with quote

HTML Style:
<br>Text<br>Text<br>Text<br>

C Style:
\n Text \n Text (or was it /n?)

PHP to make the text apear on a page:
<?php include 'text.txt' ?>
_________________
int main() {
cout << "Im Pro Apache";
cin.get();
}
Back to top View user's profile Send private message Send e-mail
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Mon Dec 13, 2004 2:06 am    Post subject: Reply with quote

TRUSTpunk wrote:
This code will brake up it , hopefully this is what you want done. Enjoy it!

Code:

<?php
$data = "graffiti.txt";
$file = file_get_contents($data);
$string = str_replace("|","<br>", $file);
echo string;
?>


When it echo's , the | character will become the break tag and will seperate
it line by line since this is what your asking for , I think this will work. LateR!


I fixed it XD! It was slightly wrong, where it says echo string there needs to be a $ sign in front of string.
Back to top View user's profile Send private message ICQ Number
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Mon Dec 13, 2004 2:08 am    Post subject: Reply with quote

I was just about to say that :P
_________________
int main() {
cout << "Im Pro Apache";
cin.get();
}
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Dec 13, 2004 2:16 am    Post subject: Reply with quote

glyde51 wrote:
TRUSTpunk wrote:
This code will brake up it , hopefully this is what you want done. Enjoy it!

Code:

<?php
$data = "graffiti.txt";
$file = file_get_contents($data);
$string = str_replace("|","<br>", $file);
echo string;
?>


When it echo's , the | character will become the break tag and will seperate
it line by line since this is what your asking for , I think this will work. LateR!


I fixed it XD! It was slightly wrong, where it says echo string there needs to be a $ sign in front of string.


I fixed it , sorry about that , sometimes you have to debug PHP lol. Later!
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group