Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Metodo per parametri numerici di default con isNan

    Codice PHP:
    function pippo(o){
        return (
    isNaN(+o))?10:o;
    }
    alert(pippo(2)); 
    che ne dite vi sembra valido come approccio ?
    invece di (o == undefined || o=='')?10


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  2. #2
    Prova
    Codice PHP:
    alert(pippo("")); 
    e guarda il risultato...

  3. #3



    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.