Home  >  Article  >  Backend Development  >  PHP array reference passing question

PHP array reference passing question

WBOY
WBOYOriginal
2016-08-04 09:19:591182browse

PHP array reference passing question
As shown in the highlighted part of the picture, how can the operation here directly change the value of the $initialcount array element? Is it feasible to add the & symbol?

Reply content:

PHP array reference passing question
As shown in the highlighted part of the picture, how can the operation here directly change the value of the $initialcount array element? Is it feasible to add the & symbol?

Your code can be modified. . There are no parameters passed, it is global in the current code.

This operation can originally assign a value to $initialcount. What went wrong? &According to my understanding, it can only be used in the parameters of the declared function.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn