How can I return a variable value from one function, pass it to another function in a class, and access it?
Code I have worked on:
<?php
class BioTool{
public function one(){
$lol =[2,3,5]; print_r($lol);
}
public function two(){
$newarr=$this->one(); //this only return the array but i can't access it, check below.
print_r($newarr[0]); //not working
}
}
$biotool=new BioTool();
$biotool->two();
Can someone help me do this?