Reading the Bible from a TXT file
Posted: Tue Mar 23, 2010 11:57 am
Hello every one, I'm sure I'm on the right place. 
Firs, I'm new to php but want to learn, so I'm getting to it, but for now here is my problem.
I'm building a website (HTML & CSS mostly) for a Christian group, they give me the bible on a text file...
so I suppose I have to put some link (when clicked) to open a PopUp with the correct row from the bible...
Inside that text file, data is separated by tabs, here are a few rows from that file to help me better explain myself.
---------------------------------------------------------------------------------------------
1 1 1 1 En el principio creó Dios los cielos y la tierra.
2 1 1 2 Y la tierra estaba desordenada y vacía, y las tinieblas estaban sobre la faz del abismo, y el espíritu de Dios se movía sobre la faz de las aguas.
3 1 1 3 Y dijo Dios: Sea la luz; y fue la luz.
4 1 1 4 Y vio Dios que la luz era buena; y apartó Dios a la luz de las tinieblas.
---------------------------------------------------------------------------------------------
The first tab is the order verse #
The second tab is the Book name
The third tab is the chapter
The forth tab is the actual verse #
the fifth tab is the actual text of that verse
So far I managed to do this:
<?php
$lines = file ("bible.txt");
$l_count = count($lines);
for($x = 0; $x< $l_count; $x++)
{
}
echo $lines[1];
?>
and I get as a resolute this:
1 1 1 1 En el principio creó Dios los cielos y la tierra.
What I need is to output the verse like this:
1. Ignore first tab
2. Convert the second tab into (a string) the books name (from an array I guess)
3. Output the third and forth tabs next to the outputted string from the second tab with a semicolon in the middle of the third and forth echo string ex. (Genesis 1:1 En el principio creó Dios los cielos y la tierra.)
4. Output the actual verse after the echoed tabs string (like in the example above)
This is possibly a ticket to heaven so there. Can some one help me with this?
Thank You for your help
Firs, I'm new to php but want to learn, so I'm getting to it, but for now here is my problem.
I'm building a website (HTML & CSS mostly) for a Christian group, they give me the bible on a text file...
so I suppose I have to put some link (when clicked) to open a PopUp with the correct row from the bible...
Inside that text file, data is separated by tabs, here are a few rows from that file to help me better explain myself.
---------------------------------------------------------------------------------------------
1 1 1 1 En el principio creó Dios los cielos y la tierra.
2 1 1 2 Y la tierra estaba desordenada y vacía, y las tinieblas estaban sobre la faz del abismo, y el espíritu de Dios se movía sobre la faz de las aguas.
3 1 1 3 Y dijo Dios: Sea la luz; y fue la luz.
4 1 1 4 Y vio Dios que la luz era buena; y apartó Dios a la luz de las tinieblas.
---------------------------------------------------------------------------------------------
The first tab is the order verse #
The second tab is the Book name
The third tab is the chapter
The forth tab is the actual verse #
the fifth tab is the actual text of that verse
So far I managed to do this:
<?php
$lines = file ("bible.txt");
$l_count = count($lines);
for($x = 0; $x< $l_count; $x++)
{
}
echo $lines[1];
?>
and I get as a resolute this:
1 1 1 1 En el principio creó Dios los cielos y la tierra.
What I need is to output the verse like this:
1. Ignore first tab
2. Convert the second tab into (a string) the books name (from an array I guess)
3. Output the third and forth tabs next to the outputted string from the second tab with a semicolon in the middle of the third and forth echo string ex. (Genesis 1:1 En el principio creó Dios los cielos y la tierra.)
4. Output the actual verse after the echoed tabs string (like in the example above)
This is possibly a ticket to heaven so there. Can some one help me with this?
Thank You for your help