We have answer of your question!

100% solved queries, no empty question

Question: How to make function arguments options?


If you have a function like so:

function somefunc ($data, $something) {

When you call the function like this:


it sends error saying it is missing argument 2. Is there a way to make the second argument optional? Thanks

Question author User2413333 | Source




function somefunc ($data, $something = null) {
Answer author Pudge601

Tickanswer.com is providing the only single recommended solution of the question How to make function arguments options? under the categories i.e php , function , parameters , . Our team of experts filter the best solution for you.

Related Search Queries:

function arguments c++ ,

You may also add your answer

Thanks for contributing an answer to Tick Answer!