26 lines
567 B
PHP
26 lines
567 B
PHP
![]() |
<?php
|
||
|
|
||
|
class common {
|
||
|
|
||
|
public static function except ($txt) {
|
||
|
|
||
|
// in any case, we log it!
|
||
|
$fp = fopen(ERROR_LOG, 'a'); //opens file in append mode
|
||
|
fwrite($fp, $txt ."\n");
|
||
|
fclose($fp);
|
||
|
|
||
|
if (DEBUG == 1) {
|
||
|
echo ($txt);
|
||
|
}
|
||
|
else {
|
||
|
echo ('There has been an error. Please try again later or contact ' .CONTACT);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static function field2csv($txt) {
|
||
|
return str_replace (array ('"', "\n"), array ('', ''), $txt);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|