+ 6
Yes✔ Following are some of the key aspects of a PHP class: Define a class with keyword “class” followed by name of the class Define the constructor method using “__construct” followed by arguments. The object of the class can then be instantiated using “new ClassName( arguments_list )” Define class variables. One could access specifiers such as private, public, protected etc. Define methods using “function” keyword. By default, PHP methods, if not specified with any access specifier becomes public in nature. That is it!
30th Jan 2020, 7:29 PM
Yaseen Akbari
Yaseen Akbari - avatar
+ 7
Of course. Here's my example of OOP and classes https://code.sololearn.com/wZF3LsZ5DNia/?ref=app
1st Feb 2020, 8:12 AM
Igor Makarsky
Igor Makarsky - avatar
+ 5
Show us a try. Also check for same questions. https://www.sololearn.com/Discuss/1316935/welcome-to-sololearn-forum/ All python concepts are explained in the tutorial here. https://www.sololearn.com/Course/Python/
30th Jan 2020, 12:43 PM
Black Winter
+ 4
Would you mind explaining why you ask so many unrelated questions(Python, PHP, Java) in a short period of time, all with a self-upvote? https://www.sololearn.com/discuss/2151688/?ref=app https://www.sololearn.com/discuss/2151649/?ref=app https://www.sololearn.com/discuss/2151669/?ref=app https://www.sololearn.com/discuss/2151656/?ref=app https://www.sololearn.com/discuss/2151645/?ref=app https://www.sololearn.com/discuss/2151679/?ref=app If it is for that Asker badge in SoloLearn profile, may I remind you that these achievements are virtual and you can take them back to real life. Only the programming knowledge developed can accompany you with your career. Please stay focus on learning.
30th Jan 2020, 1:27 PM
Gordon
Gordon - avatar
+ 4
Why not do the PHP tutorial and find out.
31st Jan 2020, 1:08 PM
Sonic
Sonic - avatar
+ 4
blackwinter I guess they are after php rather than python.
31st Jan 2020, 1:09 PM
Sonic
Sonic - avatar
+ 4
blackwinter OK 👍😁
31st Jan 2020, 1:14 PM
Sonic
Sonic - avatar
+ 3
Sonic doesn't matter .
31st Jan 2020, 1:13 PM
Black Winter
+ 1
<?php class Books { /* Member variables */ var $price; var $title; /* Member functions */ function setPrice($par){ $this->price = $par; } function getPrice(){ echo $this->price ."<br/>"; } function setTitle($par){ $this->title = $par; } function getTitle(){ echo $this->title ." <br/>"; } } ?> it is an example of creating class in php Please note that php is a weekly typed programming language
31st Jan 2020, 8:13 PM
sree harsha
sree harsha - avatar
+ 1
Yes you can
1st Feb 2020, 9:19 AM
Frivolous
Frivolous - avatar
+ 1
claro que si amigo
2nd Feb 2020, 7:26 PM
Pedro Manuel Jimenez Osuna
Pedro Manuel Jimenez Osuna - avatar
3rd Feb 2020, 8:14 AM
Felix C. Buslotan
Felix C. Buslotan - avatar