- 1
$result = preg_replace("/(\d\d,\d\d)\d\d/", "$1", $result);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+157.6
$result = preg_replace("/(\d\d,\d\d)\d\d/", "$1", $result);
Не хотелось, а пришлось - это в большом потоке не очень хорошо структурированных данных так округляются числа, с четырёх до двух знаков после запятой.
+151.4
http://suchen.mobile.de/fahrzeuge/showDetails.html?lang=ru&id=74773331&pageNumber=3&scopeId=C&sortOption.sortBy=searchNetGrossPrice&sortOption.sortOrder=ASCENDING&makeModelVariant1.makeId=17700&makeModelVariant1.modelId=13&makeModelVariant1.searchInFreetext=false&makeModelVariant2.searchInFreetext=false&makeModelVariant3.searchInFreetext=false&vehicleCategory=Car&segment=Car&minFirstRegistrationDate=1995-01-01&siteId=GERMANY&damageUnrepaired=ALSO_DAMAGE_UNREPAIRED&export=ALSO_EXPORT&customerIdsAsString=&tabNumber=2
небольшой такой запросик...
+349.7
define("_WINDOWS_",file_exists("c:\autoexec.bat") ? TRUE : FALSE);
:)
+146.3
if(isset($_POST["a"]))
{
$x=print_r($_POST["a"],true);
$x=str_replace(" [","",$x);
$x=str_replace("] => ","",$x);
$x=str_replace("Array","",$x);
$body="\n\n";
$body.=$x;
...
Отправка письма с содержимым формы.
$_POST["a"] - массив передаваемый из формы
+183
$gameid = intval($_GET['gameid']);
if (!is_int($gameid)) die ('SQL Injection protection');
+148.3
if($path != goodPath($path))
{
$notfound = true;
}
сферический индус в вакууме
+136.7
if(!connect("call.beeline.ru", "9051234567", "$sound")) { die "Ошибка!";}
else {
echo "Succefully connected!\nTrying to call..";
if(!CallNumber("9051234567")) {die "Cant call number 9051234567!";}
else {
echo "Call to number 9051234567 succefully!";
play("1.mp3"); play("4.mp3"); play("2.mp3");
}
};
шутка юмора
+143.3
<select name="wday_finish"/>
<?php
if ( $wday_finish == '-' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"-\" $default>-";
if ( $wday_finish == 'mon' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"mon\" $default>" . _("Monday");
if ( $wday_finish == 'tue' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"tue\" $default>" . _("Tuesday");
if ( $wday_finish == 'wed' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"wed\" $default>" . _("Wednesday");
if ( $wday_finish == 'thu' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"thu\" $default>" . _("Thursday");
if ( $wday_finish == 'fri' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"fri\" $default>" . _("Friday");
if ( $wday_finish == 'sat' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"sat\" $default>" . _("Saturday");
if ( $wday_finish == 'sun' ) { $default = ' selected'; }
else {$default = '';}
echo "<option value=\"sun\" $default>" . _("Sunday");
?>
freepbx. timeconditions module.
+152.3
<ul>
\\\".listQuery(\\\"SELECT Hidden_URL, Subdivision_Name, Subdivision_ID FROM Subdivision WHERE Parent_Sub_ID = \\\$data[Subdivision_ID] and checked=1 order by priority \\\", \\\"
<li><a href='\\\\\\\$data[Hidden_URL]'>\\\\\\\$data[Subdivision_Name]</a>
<ul>
\\\\\\\".listQuery(\\\\\\\"SELECT Hidden_URL, Subdivision_Name, Subdivision_ID FROM Subdivision WHERE Parent_Sub_ID = \\\\\\\$data[Subdivision_ID] and checked=1 order by priority \\\\\\\", \\\\\\\"
<li><a href='\\\\\\\\\\\\\\\$data[Hidden_URL]'>\\\\\\\\\\\\\\\$data[Subdivision_Name]</a>
<ul>
\\\\\\\\\\\\\\\".listQuery(\\\\\\\\\\\\\\\"SELECT Hidden_URL, Subdivision_Name, Subdivision_ID FROM Subdivision WHERE Parent_Sub_ID = \\\\\\\\\\\\\\\$data[Subdivision_ID] and checked=1 order by priority \\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"
<li><a href='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$data[Hidden_URL]'>\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$data[Subdivision_Name]</a>
<ul>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\".listQuery(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"SELECT Hidden_URL, Subdivision_Name, Subdivision_ID FROM Subdivision WHERE Parent_Sub_ID = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$data[Subdivision_ID] and checked=1 order by priority \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
<li><a href='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$data[Hidden_URL]'>\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$data[Subdivision_Name]</a>
<ul></ul></li>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\").\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
</ul></li>
\\\\\\\\\\\\\\\").\\\\\\\\\\\\\\\"
</ul></li>
\\\\\\\").\\\\\\\"
</ul></li>
\\\").\\\"
</ul></li>
\").\"
</ul></li>
</li>
")."
</ul>
</div>
Вывод меню в главном макете дизайна одного сайта на базе говноCMS Netcat. Можно попроще сделать, но видимо автор торопился ;) И весь этот говнокод редактируется в textarea размерами 700x300px без всякой подсветки.
+144.3
$row=mysql_fetch_array($res);
$tr1=date("H:i",strtotime($row[0]));
$nr1=$row[1];
$row=mysql_fetch_array($res);
$tr2=date("H:i",strtotime($row[0]));
$nr2=$row[1];
НУ И зачем нужен цикл???