Jump to content


Photo

Kinda dumb question...


  • Please log in to reply
No replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 04:30 AM

I need to convert a field value in a table to a field value in another table, but they are different...

The first table has links like:
<a href="../../bible.php?passage=1John+2:9">

Here is the code from bible.php:
$tmp = $_GET['passage'];
$tmp = explode(' ',$tmp);
$book = $tmp[0];
$tmp = explode(':',$tmp[1]);
$chapter = $tmp[0];
$verse = $tmp[1];

bible.php works great for
John+3:16
but
1John 3:16 doesn't work because the table has it a 1 John 3:16

How do I insert the space between 1 and John? It has to be after I explode the $_GET...

???



This seems to have fixed it:

$tmp = $_GET['passage'];
$tmp = explode(' ',$tmp);
$book = $tmp[0];
$tmp = explode(':',$tmp[1]);
$chapter = $tmp[0];
$verse = $tmp[1];

$book=str_replace("1","1 ",$book);
$book=str_replace("2","2 ",$book);
$book=str_replace("3","3 ",$book)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users