Question [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Question [SOLVED]

What does the * mean in php?

27th May 2018, 6:02 PM
Dylan McKinstry
Dylan McKinstry - avatar
7 Answers
+ 3
You're welcome, glad it helps : ) Would you mind to add prefix [SOLVED] to the question title? it helps others to understand the case is solved ; ) e.g. [SOLVED] Question ...
27th May 2018, 8:08 PM
Ipang
+ 5
Ah, alright, you must have meant the default argument, well, the default argument is a function's argument having a specified value; where the default value specified will be used if there is no value passed into it when the function is called. I seem to have missed the use of * on that chapter, except if you were referring to the quiz following the explanation, where you were to fill in the blanks. There it is used to multiply the first argument with the second (which has a default value) and return the product, I hope this is what you meant. Hth, cmiiw
27th May 2018, 7:19 PM
Ipang
+ 4
I can't answer that without enough information, it's contextual, where did you see that? if it is in the lesson mention the chapter, if it is in external source you need to post the link.
27th May 2018, 6:22 PM
Ipang
+ 3
I suppose it is a multiplication operator, like when you go echo(5*4); You get 20 printed on screen. Hth, cmiiw
27th May 2018, 6:07 PM
Ipang
+ 2
sorry should have been more speicate Counter is dealing with the * mean?
27th May 2018, 6:11 PM
Dylan McKinstry
Dylan McKinstry - avatar
+ 2
function setCounter($num=10) { echo "Counter is ".$num; } setCounter(42); //Counter is 42 setCounter(); //Counter is 10 on the lesson php define argument
27th May 2018, 6:49 PM
Dylan McKinstry
Dylan McKinstry - avatar
+ 2
yes it was thank you!
27th May 2018, 8:05 PM
Dylan McKinstry
Dylan McKinstry - avatar