top-image

Archivio di agosto, 2009

Controllare se un elemento esiste [javascript]
  function elementExists(id) { var el = document.getElementById(id);   if (el != null) { return true; }   return false; }   if (elementExists('column')) { // Column exists }   fonte: www.sastgroup.com ...leggi tutto»
Creare  un semplice debug in php!
  < ?php /** * Outputs/Debugs a variable and shows where it was called from * @param mixed $var * @param boolean $dump * @param boolean $backtrace * @return string */ function debug($var, $dump = false, $backtrace = true) { if (error_reporting() > 0) { if ($backtrace) { $calledFrom = debug_backtrace(); echo '' . trim(str_replace($_SERVER['DOCUMENT_ROOT'], '', $calledFrom[0]['file'])) . ' (line ' . $calledFrom[0]['line'] . ')'; }   echo ' '; $function = ($dump) ? 'var_dump' : 'print_r'; $function($var); echo ' '; } } ?> Utilizzo   < ?php debug($_SERVER);   // var_dump() instead of print_r() debug($_SERVER, true);   // Do not display the backtrace debug($_SERVER, false, false); ?>   fonte: www.sastgroup.com ...leggi tutto»
Pagina 16 di 16:« Prima« 13 14 15 16
bottom-img