-
+153
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
while(true) // Последующие недели.
{
for($i = 0; $i < 7; $i++)
{
if($this->date_count > $this->all_days)
break;
else
{
$this->calendar_table[$this->week_counter][$i] = $this->date_count;
$this->date_count++;
}
}
if($this->date_count > $this->all_days)
break;
$this->week_counter++;
}
Заполнение массива с датами для календаря после первой недели...
Grockles,
25 Августа 2009
-
+156
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
class DbSimple_Generic_Database extends DbSimple_Generic_LastError
{
...
/**
* Virtual protected methods
*/
function ____________PROTECTED() {} // for phpEclipse outline
...
}
ой какая красотень у нас будет в аутлайне теперь...
Smoke,
25 Августа 2009
-
+161
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
$id_country = 0;
$id_region = 0;
$id_city = 0;
$zip_code = 0;
if(isset($_REQUEST["id_country"]))
{
$id_country=$_REQUEST["id_country"];
}
if(isset($_REQUEST["id_region"]))
{
$id_region=$_REQUEST["id_region"];
}
if(isset($_REQUEST["id_city"]))
{
$id_city=$_REQUEST["id_city"];
}
if(isset($_REQUEST["zip_code"]))//проверка zip кода
{
$zip_code=$_REQUEST["zip_code"];
}
$id_country=strip_tags(trim(strval($_REQUEST["id_country"])));
$id_region=strip_tags(trim(strval($_REQUEST["id_region"])));
$id_city=strip_tags(trim(strval($_REQUEST["id_city"])));
$zip_code=strip_tags(trim(strval($_REQUEST["zip_code"])));
..........................
//переходим на Шаг 2 решистрации
header("location: ./registration.php?sel=2");
..........................
Индусы среди нас!
Bartelby,
25 Августа 2009
-
+150.9
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
//$arr - array with arbitrary keys
end($arr);
do {
if( <some condition> ) {
<something of no importance>
unset($arr[key($arr)]);
}
else {
<something of no importance>
}
} while( prev($arr) !== false );
Предполагалось, что на входе будет непустой массив. Потом он будет пролистан с конца (это необходимо) и из него по некоторому условию исключаются элементы. При этом после первого исключения итератор оказывается вне массива и prev() возвращает false (в самом массиве false не размещён заведомо).
interested,
25 Августа 2009
-
+160
- 1
foreach($query->result_array() as $row) $res[] = $row;
P.s на сайте не работает галочка "принять рецензию" в 4 хроме, а в 6 ие(который я включил, чтобы здесь накласть) не видно текстареи, но вроде работает :)
xscript,
24 Августа 2009
-
+158
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
for($i=$start; $i<$end; $i++) {
$v=$items[$idx[$i]];
}
$start = 0;
$end = count($items);
if (is_array($idx))
{
}
else
{
unset($idx);
$idx[0] = 0;
}
Хоть и вырвано из контекста, но общая красота от этого не теряется.
stan,
24 Августа 2009
-
+153.1
- 1
- 2
- 3
- 4
- 5
function thaw() {
$this->get_lock();
$vals = $this->that->ac_get_value($this->id, $this->name);
eval(sprintf(";%s",$vals));
}
vals, this, that.. еще не хватает комментов типа // eval something, return nothing
lock видимо отпускать и не надо...
shitcoder,
24 Августа 2009
-
+169.6
- 1
echo "<td valign=".chr(34)."middle".chr(34)." align=".chr(34)."center".chr(34).">";
не умеем экранировать кавычки :))))
govnokoder,
24 Августа 2009
-
+159.1
- 1
- 2
- 3
- 4
- 5
- 6
$from = 'UTF-8';
$to = 'windows-1251';
if(!$decode) {
$from = $to;
$to = 'UTF-8';
}
Обмен переменными в обвеске для iconv, одной мало известной cms
iwill,
24 Августа 2009
-
+152.9
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
<html><body>
<?php
if (isset($_POST['regg'])){
?>
<form method="post" action="2.php">
name
<input type='text' name='name' />
<input type='submit' name='regg' value='otpr' />
</form>
<?php
} else {
echo $_POST['name'];
}
?>
</body></html>
Tex,
22 Августа 2009