sentence = trim($sentence); $this->row = $row + 1; $this->cr = array("\r\n", "\r"); } public function createSentenceArray() { //改行コードの変換 $this->sentence = str_replace("\\", "", $this->sentence); $this->sentence = str_replace($this->cr, "\n", $this->sentence); //改行コードで分割 $this->sentenceArray = explode("\n", $this->sentence); //最後の行が空白かどうか if (($this->sentenceArray[$this->row - 1] == null) && ($this->row >= 1)) { $this->row--; } } public function getRow() { return $this->row; } public function getSentenceArray() { return $this->sentenceArray; } }