Much like the manual, use an equals (=
) sign in your definition of the parameters:
function dosomething($var1, $var2, $var3 = 'somevalue'){
// Rest of function here...
}
More Related Contents:
- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in? [duplicate]
- Concatenate 2 vars simultaniously
- How to find value between commas
- get user timezone [duplicate]
- PHP ini file_get_contents external url
- How to initialize static variables
- mysqli_query() expects parameter 1 to be mysqli, object given
- PHP PDO – Bind table name? [duplicate]
- Notice: Array to string conversion in
- How to search for slash (\) in MySQL? and why escaping (\) not required for where (=) but for Like is required?
- PHP Getting Domain Name From Subdomain
- Export MySQL database using PHP [closed]
- How to add new column to MYSQL table?
- How to delete object from array inside foreach loop?
- Detect if PHP session exists
- php regex to get string inside href tag
- How to calculate time difference in PHP? [duplicate]
- How to obtain anchor part of URL after # in php
- Detect file encoding in PHP
- What is the max key size for an array in PHP?
- PHP: Static and non Static functions and Objects
- HTML PHP Progress Bar
- PHP – most lightweight psr-0 compliant autoloader
- What’s the best way to localise a date on Laravel?
- How do I determine the extension(s) associated with a MIME type in PHP?
- Role Based Access Control
- GET a coupon code via URL and apply it in WooCommerce Checkout page [closed]
- Regular expression: find range except for one letter or a range
- PHP XML inserting element after (or before) another element
- PHP How to remove last part of a path