Subject: | on peut simplifier juste ceci :... |
Summary: | Package rating comment |
Messages: | 4 |
Author: | Yves Marie HAMAYON |
Date: | 2014-11-18 16:08:38 |
|
|
|
Yves Marie HAMAYON rated this package as follows:
Utility: | Good |
Consistency: | Good |
Examples: | Good |
|
 Yves Marie HAMAYON - 2014-11-18 16:08:38
on peut simplifier juste ceci :
return $this->{"read_$file_ext"}();
bravo
 Aditya Sarkar - 2014-11-19 06:06:13 - In reply to message 1 from Yves Marie HAMAYON
Can you please write it again in english?
 Aditya Sarkar - 2014-11-19 06:06:14 - In reply to message 1 from Yves Marie HAMAYON
Can you please write it again in english?
 Yves Marie HAMAYON - 2014-11-19 18:02:34 - In reply to message 3 from Aditya Sarkar
if($file_ext == "doc" || $file_ext == "docx"){
if($file_ext == "doc") {
return $this->read_doc();
} else {
return $this->read_docx();
}
} else if( $file_ext == "pdf" ){
$this->setFilename( $this->filename );
$this->decodePDF();
return $this->output();
} else {
return "Invalid File Type";
}
//--
// we can write : (just a little modif, not important)
//--
if($file_ext == "doc" || $file_ext == "docx"){
return $this->{"read_$file_ext"}();
}else if($file_ext == "pdf"){
$this->setFilename( $this->filename );
$this->decodePDF();
return $this->output();
}else{
return "Invalid File Type";
}
|