This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code": 200, | |
"status": "success", | |
"message": "Data successfully retrieved", | |
"data": { | |
"doctors": [] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code": 500, | |
"status": "error", | |
"message": "Something Went Wrong", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$speciality = $_POST['speciality'] ?? ''; | |
$name = $_POST['name'] ?? ''; | |
$hospital_id = $_POST['hospital_id'] ?? ''; | |
$experience = $_POST['experience'] ?? ''; //query will be greter than or equal to $experience | |
$fees = $_POST['fees'] ?? '';//query will be less than or equal to $fees | |
$conn = new PDO('DB connection string here'); | |
$search_conditions = ''; | |
$search_conditions .= !empty($name) ? " AND name LIKE % $conn->quote($name) % " : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code": 200, | |
"status": "success", | |
"message": "Data successfully retrieved", | |
"data": { | |
"doctors": [ | |
{ | |
"id": 2, | |
"dr_type": "Specialists", | |
"name": "Dr. Mostafa Kamal", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Instanceof will return boolean if the object is an instance of a class | |
class Tome { | |
} | |
$k = new Tome(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface World | |
{ | |
public function draw_flag(); | |
} | |
interface Animal | |
{ | |
public function sounds(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class World{ | |
//Abstract class can contain variable | |
public $var1 = 'hello ' . 'world'; | |
//Abstract class can also contain constant | |
const b = 'i\'m a constant'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface World{ | |
public function draw_map($country_name); | |
public function draw_flag($country_name); | |
const b = 'Interface constant'; | |
//Fatal error: Interfaces may not include member variables | |
public $var1 = 'hello ' . 'world'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class World{ | |
abstract public function show_population($country_name); | |
abstract protected function draw_map($country_name); | |
//Fatal error: Abstract function World::draw_flag() cannot be declared private | |
abstract private function draw_flag($country_name); | |
public function show_info(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface World{ | |
public function draw_map($country_name); | |
//Fatal error: Access type for interface method World::draw_flag() must be omitted | |
protected function draw_flag($country_name); | |
NewerOlder