View previous topic :: View next topic |
Author |
Message |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Mon Dec 13, 2004 1:25 am Post subject: Script Maker |
|
|
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 |
 |
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Mon Dec 13, 2004 1:42 am Post subject: |
|
|
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 |
|
 |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Mon Dec 13, 2004 1:46 am Post subject: |
|
|
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 |
 |
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Dec 13, 2004 2:00 am Post subject: |
|
|
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 |
|
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Mon Dec 13, 2004 2:02 am Post subject: |
|
|
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 |
|
 |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Mon Dec 13, 2004 2:06 am Post subject: |
|
|
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 |
 |
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Mon Dec 13, 2004 2:08 am Post subject: |
|
|
I was just about to say that :P _________________ int main() {
cout << "Im Pro Apache";
cin.get();
} |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Dec 13, 2004 2:16 am Post subject: |
|
|
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 |
|
 |
|