The most viewed posts

How to clean up Windows Computer

About Desktop Icons in Windows Computer

Driver Booster

CCleaner

some (JavaScript Array Method)

Registry Reviver

Advanced System Care

Myanmar font and keyboard for Windows

How to sell IT materials in zilastar.com

How to make a computer secure and run faster

The most viewed items

Desktop Hard Disk

Dell Inspiron 5559

HP ProBook 430

SONY Playstation Portable

Laptop RAM

External Hard Disk

Laptop

ZilaStar ICT Jun 11 2019, 12:15:54

Matching with function in php


<?php
$string = 'I am Thet Naing Win and who are you?';
$find = '/000/';

function Match($find, $string){
  if(preg_match($find, $string)){
   return true;
  }else{
   return false;
  }
}

if(Match($find, $string)){
  echo 'Match Found!';
}else{
  echo 'Match Not Found!';
}
?>


ZilaStar ICT Jun 11 2019, 11:43:27

Matching in php

<?php
$string = 'Hi How are you?. I am Thet Naing Win. Nice to meet you!';
$find = '/000/';
if (preg_match($find, $string)){
  echo 'Match Found!';
}else{
  echo 'Match Not Found!';
}
?>


ZilaStar ICT Jun 11 2019, 13:18:59

Randomization in php

<?php
if(isset($_POST['roll'])){
 $rand = rand(000, 999);
 echo 'You rolled a '.$rand.'.';
}
?>

<form action = "rand.php" method = "POST">
<input type = "submit" name = "roll" value = "Roll a Dice">
</form>


ZilaStar ICT Jun 11 2019, 13:10:22

Using html form in php

<?php
 if(isset($_POST["username"]) && isset($_POST["password"])){
  $username = $_POST["username"];
  $password = $_POST["password"];

  if(!empty($username) && !empty($password)){
   echo 'Welcome to TNW, '.$username.'!';
  }else{
   echo 'Fill in all fields!';
  }
 }
?>

<form action = "test.php" method = "POST">
 Username:<br />
 <input type = "text" name = "username"><br /><br />
 Password:<br />
 <input type = "password" name = "password"><br /><br />
 <input type = "submit" value = "Log In">
</form>


ZilaStar ICT Jun 10 2019, 14:54:47

Function with return value in php

<?php
function Add($num1, $num2){
$result = $num1 + $num2;
return $result;
}

function Divide($num1, $num2){
  $result = $num1/$num2;
  return $result;
}
$info = Add(Add(5,5), Divide(4,2));
echo $info;
?>


ZilaStar ICT Jun 09 2019, 14:51:04

Function in php

<?php
function MyName(){
echo 'Thet Naing Win.';
}
echo 'My Name is ';
MyName();
?>


ZilaStar ICT Jun 09 2019, 11:34:07

Do while loop in php

<?php
$count = 1;
$message = 'Hello!';
do {
  echo $count.'. '.$message.'</br>';
  $count ++;
}
while($count<=10)
?>


ZilaStar ICT Jun 08 2019, 11:30:27

While loop in php

<?php
$text = 'I am Thet Naing Win.';
$count = 1;
while($count <= 10){
  echo $count. ' '.$text.'!</br>';
  $count ++;
}
?>


ZilaStar ICT Jun 07 2019, 11:20:16

For loop in php

<?php
$text = 'I am Thet Naing Win.';
for($count = 1; $count <= 10; $count++){
echo $count. ' '.$text. '!</br>';
}
?>


ZilaStar ICT Jun 06 2019, 13:31:16

For each statement in php

<?php
 $food = array('Healthy'=>array('Salad', 'Milk', 'Coconet', 'Ground_nut'),

              'Unhealthy'=>array('Alcohol', 'Beer', 'Ice_cream'));

foreach($food as $element => $inner_element){
  echo '</br><strong>'.$element.'</strong></br>';

foreach($inner_element as $item){
  echo $item.'</br>';
}
}
?>


ZilaStar ICT Jun 06 2019, 11:18:26

Switch statement in php

$date = 'Sunday';

switch($date){
case 'Saturday';
case 'Sunday';
echo 'It is weekend!';
break;

default;
echo 'It is not weekend day!';
break;
}
?>


ZilaStar ICT Jun 05 2019, 11:13:13

If statement in php

<?php
$num1 = 30;
$num2 = 40;
if($num1 > $num2){
  echo 'Num1 is greater than Num2!';
} else if($num1 == $num2){
  echo 'Num1 and Num2 are equal!';
}else{
  echo 'Num2 is greater than Num1!';
}
?>


Page : 18 of 30
To Contact
Available Services
Terms and Conditions