https://github.com/firmanjs/essay-test
https://github.com/firmanjs/essay-test
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/firmanjs/essay-test
- Owner: firmanJS
- Created: 2020-05-13T07:42:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T08:10:57.000Z (almost 6 years ago)
- Last Synced: 2025-02-02T09:41:36.552Z (about 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# essay-test
1. ```php
$v = '1,2,3,4,5,6,7';
$sum = array_sum(explode(',', $v));
echo $sum;
```
1. a. Email
```php
$email = "test@gmail.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "valid email address";
} else {
echo "not a valid email address";
}
```
b. Phone
```php
$phone = '123';
if (is_numeric($phone)) {
echo "valid phone number";
} else {
echo "not a valid phone number";
}
```
c. Name
```php
$name = 'example';
if(preg_match("/^([a-zA-Z' ]+)$/",$name)){
echo 'Valid name.';
}else{
echo 'Invalid name.';
}
```
1.
1.
1. cara cepat -> `ob_start();`
1. `7`
1. - Model -> Bertugas untuk mengatur, menyiapkan, memanipulasi dan mengorganisasikan data (dari database) sesuai dengan instruksi dari controller.
- View -> Bertugas untuk menyajikan informasi (yang mudah dimengerti) kepada user sesuai dengan instruksi dari controller.
- Controller -> Bertugas untuk mengatur apa yang harus dilakukan model, dan view mana yang harus ditampilkan berdasarkan permintaan dari user. Namun, terkadang permintaan dari user tidak selalu memerlukan aksi dari model. Misalnya seperti menampilkan halaman form untuk registrasi user.
1. Next latter is T
1.
1.