parameter in function even not isset ,still work

user1775888

Is it possible call a function, whatever the parameter isset or not,
how to do it?

select();
select($response_message);

function select($response_message) {
  ....
}
castis

For PHP, when you declare the function, put in a default value

function select($response_message = 'whatever') {
    ....
}

At this point, select() and select('whatever') run the same thing.

for more information on PHP

As for javascript, that process is a little more involved

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Why doesn't my homemade isset function in javascript completely work?

분류에서Dev

Exception "Procedure or function expects parameter, which was not supplied." thrown even after supplying the parameter

분류에서Dev

call isset from function inside class

분류에서Dev

if(isset($_POST("submit"))) will not work unless i name the submit = "submit"

분류에서Dev

Download/upload still going even though internet is gone

분류에서Dev

PhpMyAdmin still presents login page even when 'AllowNoPassword' is set to true

분류에서Dev

Layout dimensions still return 0 even after onCreate()

분류에서Dev

Python: Even after an if runs, the else still runs as well

분류에서Dev

Make GWT application to work even in low bandwidth

분류에서Dev

AngularJS function DI parameter

분류에서Dev

Parameterized Runnable with function parameter

분류에서Dev

Manually calling controller method with parameter and still have method injection

분류에서Dev

Onclick function doesnt work

분류에서Dev

how to make this function work?

분류에서Dev

Will an Xcode project with Background Fetch turned on still work on iOS 6

분류에서Dev

Will a sql server product key still work after moving a virtual machine?

분류에서Dev

Is the Jolicloud DE still available and what versions does it work with?

분류에서Dev

Extjs 4.2 Parameter in listeners function

분류에서Dev

Why is this recursion function parameter nil?

분류에서Dev

C function crashed at array parameter

분류에서Dev

what is wrong with the template function parameter

분류에서Dev

Firebreath - passing parameter in callback function

분류에서Dev

Firebreath - passing parameter in callback function

분류에서Dev

Not Getting Which Parameter will Pass to the Function

분류에서Dev

bash function - use . character as parameter

분류에서Dev

Javascript function parameter in curling braces

분류에서Dev

Passing query as a parameter to udf function

분류에서Dev

python pass variable to function parameter

분류에서Dev

Even after putting actions handlers in 'actions' object, I still keep getting a deprecation message in Emberjs

Related 관련 기사

  1. 1

    Why doesn't my homemade isset function in javascript completely work?

  2. 2

    Exception "Procedure or function expects parameter, which was not supplied." thrown even after supplying the parameter

  3. 3

    call isset from function inside class

  4. 4

    if(isset($_POST("submit"))) will not work unless i name the submit = "submit"

  5. 5

    Download/upload still going even though internet is gone

  6. 6

    PhpMyAdmin still presents login page even when 'AllowNoPassword' is set to true

  7. 7

    Layout dimensions still return 0 even after onCreate()

  8. 8

    Python: Even after an if runs, the else still runs as well

  9. 9

    Make GWT application to work even in low bandwidth

  10. 10

    AngularJS function DI parameter

  11. 11

    Parameterized Runnable with function parameter

  12. 12

    Manually calling controller method with parameter and still have method injection

  13. 13

    Onclick function doesnt work

  14. 14

    how to make this function work?

  15. 15

    Will an Xcode project with Background Fetch turned on still work on iOS 6

  16. 16

    Will a sql server product key still work after moving a virtual machine?

  17. 17

    Is the Jolicloud DE still available and what versions does it work with?

  18. 18

    Extjs 4.2 Parameter in listeners function

  19. 19

    Why is this recursion function parameter nil?

  20. 20

    C function crashed at array parameter

  21. 21

    what is wrong with the template function parameter

  22. 22

    Firebreath - passing parameter in callback function

  23. 23

    Firebreath - passing parameter in callback function

  24. 24

    Not Getting Which Parameter will Pass to the Function

  25. 25

    bash function - use . character as parameter

  26. 26

    Javascript function parameter in curling braces

  27. 27

    Passing query as a parameter to udf function

  28. 28

    python pass variable to function parameter

  29. 29

    Even after putting actions handlers in 'actions' object, I still keep getting a deprecation message in Emberjs

뜨겁다태그

보관