PHP တွင် တန်ဖိုးများထည့်သွင်းပြီး စာကြောင်းထုတ်ပြခြင်း

printfsprintf
Задание 1

အောက်ပါ variable ကို ပေးထားသည်။

php<?php
  $price = 19.99;
?>

အောက်ပါ format ဖြင့် စျေးနှုန်းကို ထုတ်ပြပါ။

php'price: 19.99'
Задание 2

အောက်ပါ variable များကို ပေးထားသည်။

php<?php
  $name = "John";
  $age = 25;
?>

�ောက်ပါ format ဖြင့် စာကြောင်းကို ထုတ်ပြပါ။

php'Name: John, Age: 25 years'
Задание 3

အောက်ပါ variable များကို ပေးထားသည်။

php<?php
  $name = 'John';
  $score = 95;
?>

အောက်ပါ စာကြောင်းကို ထုတ်ပြပါ။

php'student John scored 95 points'
Задание 4

အောက်ပါ variable များကို ပေးထားသည်။

php<?php
  $product = "Laptop";
  $price = 1299.99;
  $discount = 15;
?>

အောက်ပါ format ဖြင့် ပစ္စည်းအချက်အလက်ကို ထုတ်ပြပါ။

php'Product: Laptop | Price: $1299.99 | Discount: 15%'
Задание 5

အောက်ပါ variable များကို ပေးထားသည်။

php<?php
  $x = 10;
  $y = 20;
  $z = 30;
?>

အောက်ပါ format ဖြင့် ရလဒ်ကို ထုတ်ပြပါ။

php'Sum: 10 + 20 + 30 = 60'
Задание 6

အောက်ပါ variable များကို ပေးထားသည်။

php<?php
  $day = 15;
  $month = "March";
  $year = 2023;
?>

အောက်ပါ format ဖြင့် ရက်စွဲကို ထုတ်ပြပါ။

php'Date: March 15, 2023'