1. Go to this page and download the library: Download adityasetiono/php-functions library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adityasetiono / php-functions example snippets
use function adityasetiono\util\{deserialize, serialize, generate_alphanumeric};
$string = generate_alphanumeric(5);
// => "aR4z0"
// User.php
class User {
protected $firstName;
protected $lastName;
protected $email;
protected $username;
public function setFirstName(string $firstName): User
{
$this->firstName = $firstName;
return $this;
}
public function getFirstName(): string
{
return $this->firstName;
}
public function setLastName(string $lastName): User
{
$this->lastName = $lastName;
return $this;
}
public function getLastName(): string
{
return $this->lastName;
}
public function setEmail(string $email): User
{
$this->email = $email;
return $this;
}
public function getEmail(): string
{
return $this->email;
}
public function setUsername(string $username): User
{
$this->username = $username;
return $this;
}
public function getUsername(): string
{
return $this->username;
}
}