Skip to content

Instantly share code, notes, and snippets.

@ichadhr
Created October 14, 2021 07:05
Show Gist options
  • Save ichadhr/63b0e79bcfefe7a820eeb09d2d6d7e63 to your computer and use it in GitHub Desktop.
Save ichadhr/63b0e79bcfefe7a820eeb09d2d6d7e63 to your computer and use it in GitHub Desktop.
  1. What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
  1. What is the difference between $_GET and $_POST?
  2. What does the isset() function mean?
  3. Convert bellow conditional statements to ternary conditional operator?
if ($val > 8) {
  echo 'bad';
} else {
  echo 'good';
}
  1. Explain how we handle exceptions in PHP?
  2. What are the uses of explode() and implode() functions?
  3. How can we load and call library in CodeIgniter framework?
@faturprayuda
Copy link

  1. '1, 2$b'
  2. $_GET adalah metode protokol yang digunakan untuk menerima atau mengirim data melalui URL sedangkan $_POST melalui belakang layar
  3. isset() merupakan fungsi yang digunakan untuk pengecekkan suatu data apakah berbentuk array
  4. $val > 8 ? 'bad' : 'good';
  5. handle exceptions merupakan teknik debugging yg memudahkan proses ketika terjadi error pada program
  6. explode() merupakan fungsi yang digunakan untuk memisahkan dengan suatu kondisi, sedangkan implode() adalah fungsi untuk menghubungkan data yang terpisah
  7. menggunakan keyword use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment