string htmlspecialchars ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $charset [, bool $double_encode = true ]]] )
I can see that the return type is 'string' and that the function can take up to four arguments. I know that the values in caps are constants and that the last argument has a default value if not supplied.
My questions are;
How do I read this? The last three arguments are nested in square brackets - does this mean that they depend on each other in order from left to right?
Is the $flags arguements limited to only the two shown after the equals sign? (what does the '|' tell me?)
Since the last argument has a default value, is that adopted internally by the function even if the other variables ($flags, $charset and $double_encode) are not given?.
And finally, the above text isn't a function definition - so is it an API? Is there a name for what it is / says?
Many thanks,
Ten


Sign In
Create Account

Back to top









