🔒 Closed Help! What is the correct answer of this ?

Status
Not open for further replies.

Clarie

Forum Guru
Given Problem :
Screenshot_20220208-163511_Word.webp


Thanks po sa sasagot.
 
Box 1 ($name)
Box 2 (.=)
Box 3 ($title)

In short
$name .= $title;
Alternative
$name = $name . $title;

Note:
Short version kasi ang ".=" sa "A = A . B"

Meron din short version sa If else condition.

Original

$grade = 75;
if ($grade > 74) {
echo "passed";
}
else {
echo "failed";
}

Short Version
$grade = 75;
echo $grade > 74 ? "passed" : "failed";
 
Box 1 ($name)
Box 2 (.=)
Box 3 ($title)

In short
$name .= $title;
Alternative
$name = $name . $title;

Note:
Short version kasi ang ".=" sa "A = A . B"

Meron din short version sa If else condition.

Original

$grade = 75;
if ($grade > 74) {
echo "passed";
}
else {
echo "failed";
}

Short Version
$grade = 75;
echo $grade > 74 ? "passed" : "failed";
Galing idol, thank you po.
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 2
    Replies
  • 374
    Views
  • 2
    Participants
Last reply from:
Clarie

Trending Topics

Online now

Members online
1,143
Guests online
1,161
Total visitors
2,304

Forum statistics

Threads
2,287,101
Posts
29,042,393
Members
1,216,370
Latest member
thomasianfcker
Back
Top