Jump to content

Code not siplaying any info


Imtiyaaz

Recommended Posts

Hi

 

Can anyone tell me why this code is not displaying anything besides book:

 

Im new to OOP in php and need some help getting the following to run properly

 

<?php

class ShopProduct{
public $title = "Where eagles dare";
public $producerMainName = "McLean";
public $producerFirstName = "Alistair";
public $price = 179;

function getProducer(){
return "{$this->producerFirstName}";
"{$this->producerMainName}";
}
}
$product1 = new ShopProduct();
$product1->title="";
$product1->producerMainName="";
$product1->producerFirstName="";
$product1->price="";

print "Book: {$product1->getProducer()}\n";

?>

Link to comment
https://forums.phpfreaks.com/topic/260271-code-not-siplaying-any-info/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.