Hi All, May you can help me... many years ago my friend gave me php script code presented below, now i want to change it can read numbering start from zero
existing just possible read 1:1, 10:200 etc.. but i want to make also possible read from 01:01, 0000002:0120 etc...
function is_valid_number($sesuatu)
{
if(preg_match("/^([0-9]+)$/", $sesuatu)) return(TRUE);
else return(FALSE);
}
//--------------
if(isset($teks["chapter"]) && (is_valid_number($teks["chapter"]) === FALSE))
{
if(strcmp($teks["chapter"], "") != 0) echo "".Chapter_need_number.""; //bhs
unset($teks["chapter"]); //Just get rid of it.
}
if(isset($teks["verse"]) && (is_valid_number($teks["verse"]) === FALSE))
{
//There is a non-numerical character in verse. We /should/ be able to examine it for range.
$temp_array = explode("-", $teks["verse"], 2);
if(isset($temp_array[0]) && isset($temp_array[1]) && is_valid_number($temp_array[0]) === TRUE && is_valid_number($temp_array[1]) === TRUE)
{
$teks["verse"] = $temp_array[0];
$teks["verse_end"] = $temp_array[1];
// echo ("<h3>".Verse_range." \"" . $temp_array[0] . "\" - \"" . $temp_array[1] . "\"</h3>\n"); //bhs
if($teks["verse_end"] <= $teks["verse"])
{
echo "".Verse_range_need_larger_ending."";//bhs
unset($teks["verse"]);
unset($teks["verse_end"]);
}
}
else
{
if(strcmp($teks["verse"], "") != 0) echo "".Verse_need_number.""; //bhs
unset($teks["verse"]); //Just get rid of it.
}
}
if(isset($teks["verse"]) && !isset($teks["chapter"]))
{
echo "".Verse_need_chapter.""; //bhs
unset($teks["verse"]); //Just get rid of it.
}
//--------------
thank you