Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?
$word = "_d1d2Dwwee12eed.";
$info = array();
$last = "";
echo $word;
for($i=0;$i<strlen($word);$i++) {
if($i==0) {
if($word[0] == "." || $word[0] == "_") {
$info[] = "Starts with \".\" or \"_\"";
}
}
if($i == strlen($word)-1) {
if($word[$i] == "." || $word[$i] == "_") {
$info[] = "Ends with \".\" or \"_\"";
}
}
if($last != "") {
if($word[$i] == $last) {
$info[] = "Repeats \"$last\" on possition ".($i-2)." and ".($i-1)."";
}
}
$last = $word[$i];
}
echo "<pre>";
print_r($info);
echo "</pre>";
?>
<?php
$str="_df41sfdf43fdvvbfdb.";
$num=strlen($str);
if (preg_match("/^\_|\.{1}/", $str))
{
$return1="Starts with <b>.</b> or <b>_</b>";
}
for ($i=1; $i<$num; $i++)
{
$f=$str[$i];
$_SESSION['n']=$i;
$s=$str[$_SESSION['n']+1];
if ($f == $s)
{
$return2="Repeats in the $_SESSION[n] position of the string ! <b>$f</b> and <b>$s</b>";
}
}
if (substr($str, -1) == "." or substr($str, -1) == "_")
{
$return3="Ends with <b>.</b> or <b>_</b>";
}
echo $return1."<br />";
echo $return2."<br />";
echo $return3."<br />";
?>