PHPでインスタンスに代入した文字を引き出せるようにしたいのですが、エラーもなにもでず、何が原因か分からない状態になっています。
何が原因でしょうか???
よろしくお願いします。
php
1 2<?php 3class Content{ 4 private $title; 5 private $genre; 6 7 public function __contruct($title,$genre){ 8 $this->title = $title; 9 $this->genre = $genre; 10 } 11 12 public function getTitle() { 13 return $this->title; 14 } 15 16 public function getGenre() { 17 return $this->genre; 18 } 19} 20$hoge1 = new Content ("title1","web"); 21 22echo $hoge1->getGenre(); 23 24?> 25
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/03/13 12:36