Skip to content

Instantly share code, notes, and snippets.

@ichadhr
Created September 21, 2021 02:21
Show Gist options
  • Save ichadhr/a57f84dd83e8a617a00cb1bf8b74e523 to your computer and use it in GitHub Desktop.
Save ichadhr/a57f84dd83e8a617a00cb1bf8b74e523 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?
@hermandasril
Copy link

  1. 1,21
  2. $_POST -> get data from form
    $_GET -> get value from url
  3. pengecekan sudah di devined atau belum
  4. $val > 8 ? "bad" : "good";
  5. with try catch
  6. explode() -> memisahkan value ke dalam bentuk array
    implode() -> menggabungkan array ke dalam bentuk 1 value
  7. $this->load->library(name);

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