Thursday, December 26, 2013

أساسيات برمجة المواقع بي اتش بي - مثال على مشغلات الاسناد PHP Assignment Operators Example

3:46 AM

Share it Please

أساسيات برمجة المواقع بي اتش بي - مثال على مشغلات الاسناد


في المثال التالي نستعرض على المشغلات  الاسناد التي يمكن التعامل بها في لغة البي اتش بي.

<html>
<head><title>Assignment Operators</title><head>
<body>
<?php
    $a = 42;
    $b = 20;   
    $c = $a + $b;   /* Assignment operator */
    echo "Addtion Operation Result: $c <br/>";
    $c += $a;  /* c value was 42 + 20 = 62 */
    echo "Add AND Assigment Operation Result: $c <br/>";
    $c -= $a; /* c value was 42 + 20 + 42 = 104 */
    echo "Subtract AND Assignment Operation Result: $c <br/>";
    $c *= $a; /* c value was 104 - 42 = 62 */
    echo "Multiply AND Assignment Operation Result: $c <br/>";
    $c /= $a;  /* c value was 62 * 42 = 2604 */
    echo "Division AND Assignment Operation Result: $c <br/>";
    $c %= $a; /* c value was 2604/42 = 62*/
    echo "Modulus AND Assignment Operation Result: $c <br/>";
?>
</body>
</html>


الناتج:-

Addtion Operation Result: 62
Add AND Assigment Operation Result: 104
Subtract AND Assignment Operation Result: 62
Multiply AND Assignment Operation Result: 2604
Division AND Assignment Operation Result: 62
Modulus AND Assignment Operation Result: 20 

Ahmed Ata Almahallawi
Freelancer
IT
IT Help Desk,
SEO experience,PHP,C#,ASPX
Al alami st
gaza -jabaliaGaza Strip
Palestine
ahmed.almahallawi@gmail.com
DOB: 05/10/1984
by +Ahmed Almahallawi 
26/12/2013

0 comments :

Post a Comment