Passing a variable to a method, I need to either create the same variable, or somehow transfer it inside the method.
function foo($array) { // Создать переменную $hello // Или скопировать/переместить } $hello = "Hello, world!"; foo($hello); Then I remembered the links. But in this situation:
function foo(&$array) { // Тут мне только доступно $array, а не переменная $hello (см. выше) } How can I transfer or copy a variable?
PS It is only necessary and not otherwise :)