I have defined a few constants like this:
define("TITLE_2","Yahoo");
define("TITLE_3","Google");
Next, I want to get the constant through a function.
public function title($id) {
return TITLE_.$id;
}
Idea, I can call $this->title(2) to get Yahoo and $this->title(3) to get Google. However, it is not working. I am getting TITLE_2 or TITLE_3 in place of Yahoo or Google.
Help? Thanks.
Use the constant function