React.js
Angular
Ethical Hacking
Agile
AWS
BlockChain
Cassandra
Cloud
Salesforce
Scaled Agile
TOGAF
DevOps
GIT
Jenkins
Jira
Kibana
Linux
NGINX
Ansible
Artificial Intelligence
in PHP by
what is the static variable in function useful for?
Click here to read more about DevOps

1 Answer

0 votes
by
A static variable is defined within a function only the first time, and its value can be modified during function calls as follows:

<!--?php function testFunction() { static $testVariable = 1; echo $testVariable; $testVariable++; } testFunction();        //1 testFunction();        //2 testFunction();        //3 ?-->

Related questions

Madanswer
0 votes
asked Jun 23, 2019 in PHP by SakshiSharma
0 votes
asked Jun 23, 2019 in PHP by SakshiSharma
...