PHP Basic Part 3

A vibrant and engaging illustration depicting coding concepts, featuring PHP and HTML symbols, computer screens, and a classroom setting.

PHP Basics Quiz: Test Your Knowledge!

Welcome to the PHP Basics Quiz! This quiz is designed to challenge your understanding of fundamental PHP and HTML concepts. Whether you are a beginner or someone looking to brush up on your skills, this quiz will help assess your knowledge!

  • Answer questions about HTML tags and attributes.
  • Test your understanding of PHP variables and arrays.
  • Get instant feedback on your answers.
15 Questions4 MinutesCreated by CodingNinja42
Dalam HTML, untuk menampilkan link kita memakai tag (...) dan atribut untuk URL nya adalah (...)
, href
, src
Berikut ini special atribut yang HANYA dimiliki oleh tag
adalah :
Action
Method
Class
Src
Type
Url
Apa perbedaan tag h1 dan h2 ?
H1 ukuran font nya lebih kecil daripada h2
H2 ukuran font nya lebih kecil daripada h1
H1 font nya hanya lebih tebal daripada h2
H2 font nya hanya lebih tebal daripada h1
Untuk melalukan import style ke dalam file HTML kita, kita harus menambahkan tag (...) diantara tag (...). Misal kita akan menambahkan file CSS bootstrap ke dalam HTML kita.
Import, body
Import, head
Link, body
Link, head
Style, body
Style, head
$i = 0;
echo $i++;
 
Output dari program diatas adalah?
0
1
-1
(kosong)
(error)
$a = 3;
$b = 5;
$c = 0;
 
$a = $c;
$b = $a;
$c = $a + $b;
$a = $c - $b;
 
echo $a;
 
Apakah output program diatas?
-2
0
2
3
5
8
$a = -3;
$b = 5;
if($a > $b)
   $a = $b;
else
   $a = $a - $b;
if($a >= $b)
   $b = $a;
else
   $b = $b++;
$c = $b + $a;
echo $c;
 
Output dari program diatas adalah?
-8
-5
-3
0
2
8
$a = 0;
for($i=1; $i <= 10; $i++)
   if($i % 3 == 0)
      $a = $a + $i;
echo $a;
 
Output dari $a adalah ?
0
9
18
30
55
$a = array(1,2,3);
for($i = 3; $i < 7; $i++){
    $a[$i] = $i+1;
    $a = array();
}
 
Nilai akhir  dari variable $a adalah?
Array(1,2,3)
Array(1,2,3,4,5,6)
Array(1,2,3,4,5,6,7)
Array(4,5,6,7)
Array()
$a = array(1,2,3);
for($i = 3; $i < 7; $i++){
    $a = array();
    $a[$i] = $i+1;  
}
 
echo $a[0];
 
Output program diatas adalah?
0
1
(kosong)
(Error : Undefined offset 0)
$profile = array();
$domisili = array('Jl. Panunggangan no 72', 'Garut', 14325);
$physical = array('tinggi' => 187, 'berat' => 85, 'goldar' => 'O');
$education = 'S1 Ilmu Komputer';
$profile = array (
   'address' => $domisili,
   'bio_physical' => $physical,
   'education' => $education
);
 
Bagaimana cara mendapatkan output 'Garut'?
$profile['domisili']['Garut']
$profile['domisili'][1]
$profile['address']['Garut']
$profile['address'][1]
$domisili['address']
$domisili['Garut']
$profile = array();
$domisili = array('Jl. Panunggangan no 72', 'Garut', 14325);
$physical = array('tinggi' => 187, 'berat' => 85, 'goldar' => 'O');
$education = 'S1 Ilmu Komputer';
$profile = array (
   'address' => $domisili,
   'bio_physical' => $physical,
   'education' => $education
);
 
echo $count($profile);
 
Apakah output dari program diatas?
0
1
2
3
(kosong)
$a = $b = $c = 0;
echo $b;
 
Output dari program diatas? Benar +3 salah -3.
0
(error)
$arr = array();
array_push($arr, 1);
array_push($arr, 'Asep');
array_push($arr, 2);
array_push($arr, 'Garut');
array_push($arr, 1);
echo $arr[3];
 
Output dari program diatas adalah?
(kosong)
1
2
Asep
Garut
(error)
{"name":"PHP Basic Part 3", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Welcome to the PHP Basics Quiz! This quiz is designed to challenge your understanding of fundamental PHP and HTML concepts. Whether you are a beginner or someone looking to brush up on your skills, this quiz will help assess your knowledge!Answer questions about HTML tags and attributes.Test your understanding of PHP variables and arrays.Get instant feedback on your answers.","img":"https:/images/course7.png"}
Powered by: Quiz Maker