?>
                </small></td>
                <td><small><?php 
            echo $row["company"];
            ?>
</small></td>
                <td><small><?php 
            echo $row["address"];
            ?>
</small></td>
                <td><small><?php 
            echo getarea($row["area"]);
            ?>
</small></td>
                <td><small><?php 
            echo getcities($row["city"]);
            ?>
</small></td>
                <td><small><?php 
            echo getstate($row["state"]);
            ?>
</small></td>
                <td><small><?php 
            echo $row["activationDate"];
            ?>
</small></td>
                <td><small><?php 
            echo gettelecallername($row["refferBy"]);
            ?>
</small></td>
                <td><small>
Ejemplo n.º 2
0
}
?>
" class="form-control text_box" readonly></td>
        </tr>
        <tr >
          <td>District</td>
          <td><input type="text" name="district" id="district" value="<?php 
if (isset($result['cust_id'])) {
    echo getdistrict($result['District_id']);
}
?>
" class="form-control text_box" readonly></td>
          <td>City</td>
          <td><input type="text" name="city" id="city" value="<?php 
if (isset($result['cust_id'])) {
    echo getcities($result['City']);
}
?>
" class="form-control text_box" readonly></td>
        </tr>
        <tr >
          <td>Area</td>
          <td><input type="text" name="customer_name8" id="customer_name8" value="<?php 
if (isset($result['cust_id'])) {
    echo getarea($result['Area']);
}
?>
" class="form-control text_box" readonly></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        ?>
</small></td>
						   <td><small><?php 
        echo stripslashes($row["Phone"]);
        ?>
</small></td>
						   <td><small><?php 
        echo stripslashes($row["Mobile"]);
        ?>
</small></td>
                           <td><small><?php 
        echo getstate(stripslashes($row["State"]));
        ?>
</small></td>
                           <td><small><?php 
        echo getcities(stripslashes($row["City"]));
        ?>
</small></td>
                           <td><small><?php 
        echo getarea(stripslashes($row["Area"]));
        ?>
</small></td>
                           <td><input type='checkbox' name='linkID[]' value='<?php 
        echo $row["id"];
        ?>
'></td>
                           </tr>
 
	<?php 
    }
} else {
Ejemplo n.º 4
0
            echo "<pre>&#9;";
            foreach ($cityArray as $cityKey => $city) {
                end($cityArray);
                if ($cityKey == key($cityArray)) {
                    echo $city;
                } else {
                    echo $city . ", ";
                }
            }
            echo "<br></pre>";
        }
    }
}
getcities($regions, "");
echo "<h3>5. Вывод областей и городов начинающихся с буквы \"К\" (Работает с разными буквами и разным количеством букв для сравнения)</h3>";
getcities($regions, "К");
echo "<h3>6. Транслитерация строк</h3>";
function convertCyrillicToTranslit($stringForConvert)
{
    $alphabet = ['a' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'kh', 'ц' => 'ts', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', 'ъ' => '\'', 'ы' => 'y', 'ь' => '\'', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya'];
    $splitString = preg_split('//u', $stringForConvert, -1, PREG_SPLIT_NO_EMPTY);
    foreach ($splitString as $charKey => $char) {
        if (mb_strtolower($char, 'utf-8') == $char) {
            if (array_key_exists($char, $alphabet)) {
                echo $alphabet[$char];
            } else {
                echo $char;
            }
        } elseif (mb_strtoupper($char, 'utf-8') == $char) {
            if (array_key_exists(mb_strtolower($char, 'utf-8'), $alphabet)) {
                if ($splitString[$charKey + 1] == mb_strtolower($splitString[$charKey + 1], 'utf-8') && array_key_exists(mb_strtolower($splitString[$charKey + 1], 'utf-8'), $alphabet)) {