<?php
class obj {
var $primary_key;
function obj($key = null){
if(isset($key)){
$this->primary_key = $key;
}
echo "primary_key: ".$this->primary_key."<br/>";
$this->obj_id = 14;
echo "obj_id: ".$this->obj_id."<br/>";
$key = $this->primary_key;
echo "obj_id from primary_key string: ".$this->$key."<br/>";
}
}
?>
Is there a way to get $this->primary_key
value?
Like $this->$this->primary_key
?