Hi
I am new to php.
I have a query. I have a class which has a array member variable list1 and list2. Am trying to update it in a function and not able to.
Here is the class. Please help me.[code=php]
<?php
class simple {
var $list1;
var $list2;
function updateValue() {
$fd = fopen("/mapping", "r");
$i=0;
while(!feof($fd )) {
$info = fscanf($fd, "%s %s\n");
if ($info) {
list($name, $version) =$info;
$this->list1[$i] = $name;
$this->list2[$i] = $version;
$info = null;
$i++;
}
}
fclose($fd);
echo "$this->list1[0]";
echo "$this->list1[1]";
echo "$this->list1[2]";
}
}
?>[/code]
Thanks & Regards
VP
I am new to php.
I have a query. I have a class which has a array member variable list1 and list2. Am trying to update it in a function and not able to.
Here is the class. Please help me.[code=php]
<?php
class simple {
var $list1;
var $list2;
function updateValue() {
$fd = fopen("/mapping", "r");
$i=0;
while(!feof($fd )) {
$info = fscanf($fd, "%s %s\n");
if ($info) {
list($name, $version) =$info;
$this->list1[$i] = $name;
$this->list2[$i] = $version;
$info = null;
$i++;
}
}
fclose($fd);
echo "$this->list1[0]";
echo "$this->list1[1]";
echo "$this->list1[2]";
}
}
?>[/code]
Thanks & Regards
VP
Comment