Wednesday, October 11, 2017

String Length in PHP


<?php

$string = 'I am Thet Naing Win';
$strlen = strlen($string);
echo $strlen;

?>

Tuesday, October 10, 2017

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;

}

?>

Thursday, October 5, 2017

HTML Form



<?php


?>

<head>
<title>html form</title>
<style type="text/css">
form{border:dotted; width:300px; height:auto; color: orange; text-align: center; margin-top:300px;}
</style>
</head>

<form action="index.html" method="POST">
<br />
UserName<br />
<input type="text" name="username"><br /><br />
Password<br />
<input type="password" name="password"><br /><br />
<input type="submit" value="Log In">
<br /><br />
</form>