Posts

3 if elseif condition

if elseif condition   <?php $age = 4 ; if ( $age > 18 ){     echo "you can drink water with chai and alcohol" ; } elseif ( $age > 13 ){     echo "you can drink chai only with water. No alcohol for you" ; } else {     echo "you can drink water only" ; } ? >

2 Operators

Arithmetic Operators  <?php // arithmetic operators (line 8 par hai) // assignment operators (line 21 par hai) // comparision operators (line 32 par hai) // logical operators // 1. Arithmetic Operators $a = 10 ; $b = 5 ; echo "for a + b, the result is " . $a + $b . "<br>" ; echo "for a - b, the result is " . $a - $b . "<br>" ; echo "for a * b, the result is " . $a * $b . "<br>" ; echo "for a / b, the result is " . $a / $b . "<br>" ; echo "for a % b, the result is " . $a % $b . "<br>" ; // modulas operator echo "for a ** b, the result is " . $a ** $b . "<br>" ; // exponential operator echo "<br>" ; echo   $a + $b . "<br>" ; // 2. Assignment Operators // "+" ka sign "=" ke sath lagane par assign hui value me new value ko add kar deta hai $a += 2 ; ec

2 String Function folder 2

  <?php $name = "Kanha" ; echo $name ; echo "<br>" ; // "strlen" likhne se string ki Index show hoti hai // "strlen" indexing ke time "space" bhi count karta hai echo strlen ( $name ); echo "<br>" ; // agar hame do ya usse jada strings ko aapas me jodna hai to (.) laga kar jodna padega echo "strlen shows indexing " . strlen ( $name ); echo "<br>" ; // (.) se ham tino strings ko aapas me jod rahe hai echo "Krishna " . "Radha " . " $name " . strlen ( $name ); echo "<br>" ; $stringWordCount = "This is Radha Krishna" ; echo $stringWordCount ; echo "<br>" ; // "str_word_count" words count karne ke lie echo str_word_count ( $stringWordCount ); echo "<br>" ; // "strrev" words ko reverse karne ke lie echo strrev ( $stringWordCount ); echo "<br>" ; // &q

Array folder 1

<!-- PHP Data Types --> <!--     1. String     2. Integar     3. Float (Decimal)     4. Boolean (True false)     5. Object     6. Array     7. Null  --> <?php     $friends = array ( "krishna","mohan", "kanha", "damodar", "radha");     // echo ke sath var_dump laga kar print karwana ek acha tarika hai     echo var_dump ( $friends );     echo "<br>" ;     echo ( $friends [ 2 ]);     echo "<br>" ;     echo ( $friends [ 3 ]); ? >