before it is displayed on the page? I am trying to add the following function:
Code: Select all
function format_tel_num($contactNumber){ //<-- contactNumber is a field on database.
return preg_replace('/\d{3}/', '$0.', str_replace('.', null, trim($contactNumber)), 2);
}
$contactNumber = format_tel_num($contactNumber);do i need to make this function a global function outside of the loop?
Code: Select all
--query that gathers info from database--
$result= mysql_query($query)
$nrows=mysql_num_rows($result);
if ($nrows == 0) {
echo "There are no clinics listed with that criteria at this time. Please choose again.";
}
else{
while ($row = mysql_fetch_array($result))
{
extract($row);
if($logos!="../logos/profs/spacer.gif"){
echo " code that displays data from database";
}
else {
echo " coding that dislpays slightly different data from database";
}
}
}