please review the code , in the constructror $title has two value property craeteTitle($file) and $this->filearray[$file] .Is the two values contain array or string?
what will found by the function readdir()?? array or string?
if array what will return by $this->filearray[$f] and how?
please help me…
<?php
class title
{
private $directory;
private $filearray=array();
public function __construct($directory)
{
$this->directory=$directory;
if(is_dir($directory))
{
$diropen=opendir($directory) or die("failed to open directory");
if (($file=readdir($diropen))!==false)
{
if (is_file("$directory/$file"))
{
$title=$this->createTitle($file);
$this->filearray[$f]=$title;
}
}
}
else (die("it is not a directory"));
}
public function createTitle($title)
{
$title=substr($title,0,$strpos($title,"."));
}
}
?>