Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jopp289/domains/progmans.net/public_html/engine/modules/show.short.php on line 160 Все публикации пользователя admin » Шпаргалки
Заголовок






if (function_exists("array_combine"))

{

     echo "Функция существует";

}

else …...



include,  include_once,  require,  require_once



php перевод в верхний (нижний) регистр

$lowered = strtolower("СтРоКа");

echo $lowered;


strtoupper("СтРоКа");


--------------------------------------------------------------------------------------------------------

php первая буква строки в верхний регистр

ucfirst



$c = (int) ($a / $b);


(int) (integer)

(bool) (boolean)

(float) (double) (real)

(string)

(array)

(object)



while цикл

<?php

$fuel = 10;

while ($fuel > 1)

{

      // Продолжение поездки...

      echo "Топлива еще достаточно";

}

?>

 

-----------------------------------------------------------------------------------------------------

 

цикл do while

<?php

$count = 1;

do

       echo "Число $count, умноженное на 12, равно " . $count * 12 . "<br>";

while (++$count <= 12);

?>

 

-----------------------------------------------------------------------------------------------------

 

for цикл

<?php

for ($count = 1 ; $count <= 12 ; ++$count)

       echo "Число $count, умноженное на 12, равно " . $count * 12 . "<br>";

?>

 

-----------------------------------------------------------------------------------------------------

 

цикл foreach … as

<?php

$paper = array("Copier", "Inkjet", "Laser", "Photo");


$j = 0;

foreach ($paper as $item)

{

     echo "$j: $item<br>";

     ++$j;

}

?>

 

-----------------------------------------------------------------------------------------------------

 

break - выход из цикла,   continue - выход из итерации цикла

 


назад 1 2 3 4 5 6 7 8 9 10 ... 25далее