I'm writing a class (actually my first class) the when declared it gets a file path;
Code: Select all
class myClass {
public $audioFile;
function __construct($audioFile) {
$this->audioFile = $audioFile;
}
function copyTo($outFile) {
copy($this->audioFile,$outFile);
}
}Code: Select all
$a = new myClass("../temp/day.mp3");
$a->copyTo("../test.mp3");
I figure it is because the class i located in a diffrernt directory but i can't seem to fix it.
I'm sure it is because I'm absolutely green in php and there is a simple solution, i just can't find it.
Help anyone?