class AboutMe {
protected string $base = "malaysia";
protected string $first_name = "Filson";
protected string $last_name = "Teo";
protected string $email = "filsonteo@gmail.com";
protected string $description = "a software developer";
protected string $website = "https://matyo-17.github.io/";
protected string $linkedin = "https://www.linkedin.com/in/filson-teo-7a380a20b/";
protected array $fav_programming_lang = ["php", "python", "javascript"];
protected array $fields_interested = [
"software development", "artificial intelligence", "machine learning",
"robotics", "image processing",
];
protected array $open_sources = [
"https://github.com/matyo-17/mysql-backup",
"https://github.com/matyo-17/docker-laravel-stack",
];
public function introduce(): string {
$string = "<p>Name: ".$this->get_name()."</p>";
$string .= "<p>Overview: ".$this->description."</p>";
$string .= "<p>Based in: ".ucfirst($this->base)."</p>";
$string .= "<p>Website: ".$this->get_links("website")."</p>";
$string .= "<p>LinkedIn: ".$this->get_links("linkedin")."</p>";
$string .= "<p>Email: ".$this->email."</p>";
$string .= "<p>Fields interested: ".$this->array_to_string("fields_interested", true)."</p>";
$string .= "<p>Favourite programming language: ".$this->array_to_string("fav_programming_lang")."</p>";
$string .= "<p>Open sources: ".$this->array_to_string("open_sources", true, true)."<p>";
$string .= "<br>";
$string .= "<p>This is a summary of me. Visit my website for more details.</p>";
return $string;
}
private function get_name(): string {
return $this->first_name." ".$this->last_name;
}
private function get_links(string $purpose): string {
return "<a href='".$this->$purpose."'>".$this->$purpose."</a>";
}
private function array_to_string(string $var, bool $list=false, bool $links=false): string {
$string = ($list) ? "<ul>" : "";
foreach ($this->{$var} as $e) {
$string .= ($list) ? "<li>" : "";
$string .= ($links) ? "<a href='".$e."'>" : "";
$string .= $e.((!$list) ? ", " : "");
$string .= ($links) ? "</a>" : "";
$string .= ($list) ? "</li>" : "";
}
return ($list) ? $string."</ul>" : substr($string, 0, -2);
}
}
echo (new AboutMe())->introduce();
Pinned Loading
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.