Professional Web Applications Themes

How to make an argument optional...confirmation... - PHP Development

I want to create a function with an optional argument/parameter but have never read a concrete answer on how to do it. This is what I am assuming function test(arg1,arg2,arg3 = null) { arg3 will be optional } is this correct?...

  1. #1

    Default How to make an argument optional...confirmation...

    I want to create a function with an optional argument/parameter but have
    never read a concrete answer on how to do it.

    This is what I am assuming

    function test(arg1,arg2,arg3 = null)
    {
    arg3 will be optional
    }

    is this correct?

    Jonathan Villa Guest

  2. #2

    Default Re: [PHP] How to make an argument optional...confirmation...

    Hi,

    Friday, August 22, 2003, 12:55:37 PM, you wrote:
    JV> I want to create a function with an optional argument/parameter but have
    JV> never read a concrete answer on how to do it.

    JV> This is what I am assuming

    JV> function test(arg1,arg2,arg3 = null)
    JV> {
    JV> arg3 will be optional
    JV> }

    JV> is this correct?

    Yes that is correct, you don't have to use null any value can be put
    in as a default.

    --
    regards,
    Tom

    Tom Rogers Guest

  3. #3

    Default Re: [PHP] How to make an argument optional...confirmation...

    Great, thanks!!

    On Thu, 2003-08-21 at 22:20, Tom Rogers wrote:
    > Hi,
    >
    > Friday, August 22, 2003, 12:55:37 PM, you wrote:
    > JV> I want to create a function with an optional argument/parameter but have
    > JV> never read a concrete answer on how to do it.
    >
    > JV> This is what I am assuming
    >
    > JV> function test(arg1,arg2,arg3 = null)
    > JV> {
    > JV> arg3 will be optional
    > JV> }
    >
    > JV> is this correct?
    >
    > Yes that is correct, you don't have to use null any value can be put
    > in as a default.
    Jonathan Villa Guest

Similar Threads

  1. #39135 [NEW]: fpassthru with optional argument length
    By third-chance at gmx dot de in forum PHP Bugs
    Replies: 1
    Last Post: October 13th, 08:42 AM
  2. numberformat - is optional no longer optional?
    By miki in forum Macromedia ColdFusion
    Replies: 1
    Last Post: April 18th, 11:07 PM
  3. JavaScript confirmation
    By Maziar Aflatoun in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: February 15th, 01:44 PM
  4. Confirmation for a PageInedxChanged
    By Carlos in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: August 22nd, 01:02 PM
  5. confirmation
    By Daniel Carrera in forum Ruby
    Replies: 3
    Last Post: July 10th, 12:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139