AV1611 Posted March 11, 2006 Share Posted March 11, 2006 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:[code]<a href="../../bible.php?passage=1John+2:9">[/code]Here is the code from bible.php:[code]$tmp = $_GET['passage'];$tmp = explode(' ',$tmp);$book = $tmp[0];$tmp = explode(':',$tmp[1]);$chapter = $tmp[0];$verse = $tmp[1];[/code]bible.php works great for John+3:16 but1John 3:16 doesn't work because the table has it a 1 John 3:16How do I insert the space between 1 and John? It has to be after I explode the $_GET...???This seems to have fixed it:[code]$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)[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4666-kinda-dumb-question/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.