The most viewed posts

About Desktop Icons in Windows Computer

How to clean up Windows Computer

CCleaner

Driver Booster

Advanced System Care

Myanmar font and keyboard for Windows

Registry Reviver

How to make a computer secure and run faster

some (JavaScript Array Method)

Terms and Conditions

The most viewed items

Desktop Hard Disk

HP ProBook 430

Dell Inspiron 5559

External Hard Disk

SONY Playstation Portable

Laptop RAM

Laptop

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!';
}
?>


ZilaStar ICT Jun 04 2019, 13:03:41

String replace in php

<?php
$string = 'I am thet naing win';
$find = array('thet', 'naing', 'win');
$replace = array('THET', 'NAING', 'WIN');
$string_new = str_replace($find, $replace, $string);
echo $string_new;
?>


ZilaStar ICT Jun 04 2019, 12:59:44

String position in php

<?php
$string = 'I am Thet Naing Win. This is PHP Testing and Word position Test. If you are insterested in PHP, please join us!';
$find = 'T';
$find_length = strlen($find);
$offset = 1;
while ($strpos = strpos($string, $find, $offset)){
echo 'The Character <strong>'.$find. '</strong> is found at '.$strpos.'.</br>';
$offset = $strpos + $find_length;
}
?>


ZilaStar ICT Jun 03 2019, 12:54:57

String lower and upper in php

We can change all characters to lower case by using strtolower. The following code is an example.

<?php
$string = 'I am ThEt NainG WiN!';
$string_low = strtolower($string);
echo $string_low;
?>

We can also change all characters to upper case by using strtoupper. The following is an example.

<?php
$string = 'I am ThEt NAInG win!';
$string_up = strtoupper($string);
echo $string_up;
?>


ZilaStar ICT Jun 03 2019, 12:43:52

String trim in php

<?php
$string = 'I am Thet Naing Win.';
$string_trimmed = rtrim($string);
echo $string_trimmed;
?>


ZilaStar ICT Jun 02 2019, 21:40:35

String reverse in php

<?php
$string = 'I am Thet Naing Win';
$string_reversed = strrev($string);
echo $string_reversed;
?>


ZilaStar ICT Jun 01 2019, 21:37:28

String word count in php

<?php
$string = 'I am Thet Naing Win and who are you?';
$string_word_count = str_word_count($string, 1);
print_r($string_word_count);
?>


ZilaStar ICT Jun 01 2019, 21:33:13

String length in php

<?php
$string = 'I am Thet Naing Win';
$strlen = strlen($string);
echo $strlen;
?>


ZilaStar ICT Jun 01 2019, 16:54:05

Checking php version by Code

Write the following code and save it as info.php in C > xampp > htdoc.

<?php

phpinfo();

?>

Open Web Browser and type localhost/info.php in it and press Enter. Then, you will see the php version as the below picture.


ZilaStar ICT Jun 01 2019, 16:26:39

Creating first php file in Windows

We need Apache Service to run php codes. Now I hope you've already installed the Apache Service in your Windows PC. If you have not installed, please click here.

We need Text Editor to write php codes. If you don't have any text Editor, please click here.

If you've completed the above steps. We will start to write php codes.

1. Open your Text Editor (here I use ConText) and create New File.

2. Choose PHP instead of Text files as the below picture.

3. Save that file as test.php in the C > xampp > htdoc.

4. In test.php, write the following codes.

   


ZilaStar ICT Jun 01 2019, 15:53:21

Text Editor for Windows PC

We need Text Editor to write programming codes. ConText is one of the best open source text editors. Please click here to download.


ZilaStar ICT May 30 2019, 18:07:37

Installing Xampp for Apache Service in Windows

We need Apache service to run php codes. Xampp is the open source software we can use as Apache Server in Windows. Please click here to download.

Before installing Xampp in Windows PC, you better decrease UAC Level and disable Firewall or Antivirus.You can set back default setting after installation.



How to decrease UAC Level

1. Type uac in the search box and press Enter.User Account Control Setting Box will be appeared.

2. Choose Lowest Level and Click Ok.


How to disable Firewall

1. Press Windows and R Keys together at the same time.Run Box will be appeared.

2. Type firewall.cpl in the Run Box and click OK.

2. Click Windows Firewall on or off.

3. Choose Turn off Windows Firewall and click OK.


Then, start to run the exe file you've downloaded and follow the procedures.It will take some time to finish installation.

Now, I hope you've successful installed. Open the Xampp Control Panel. Start Apache and MySQL. You will see as the following picture.



To test Apache Service in Windows,

Open Web Browser and type localhost in it and press Enter. You will as the following picture.


1. To check php version, click PHPInfo.

2. To MySQL Service, click phpMyAdmin.


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