Tell me how can we define a variable accessible in functions of a php script?
Answer / Kavendra Singh Sagar
To define a variable that is accessible in functions of a PHP script, you should use the global keyword. Here's an example:nn```phpnfunction myFunction() {n global $myVar;n // You can now access and modify $myVar inside this functionn}n$myVar = 'example';nmyFunction();n$myVar = 'modified';n``
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the Merits and De-Merits of CURL library ?
what the new feature add in php 7.2?
how to display and include the user system date/time in a php program/project
What are the new features available in php 7?
What is the difference server side and browser side validation?
Tell me how can we get the error when there is a problem to upload a file?
Explain how you can update memcached when you make changes to php?
Which methods should be used for sending an email using the variables $to, $subject, and $body?
How can i send a HTML file to mail account.
How can you pass a variable by reference?
What is prepared statement in php?
What does php do?