This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rus2translit($string) { | |
$converter = array( | |
'а' => 'a', 'б' => 'b', 'в' => 'v', | |
'г' => 'g', 'д' => 'd', 'е' => 'e', | |
'ё' => 'e', 'ж' => 'zh', 'з' => 'z', | |
'и' => 'i', 'й' => 'y', 'к' => 'k', | |
'л' => 'l', 'м' => 'm', 'н' => 'n', | |
'о' => 'o', 'п' => 'p', 'р' => 'r', | |
'с' => 's', 'т' => 't', 'у' => 'u', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `offer`( | |
`_ID` INT NOT NULL, | |
`_IDoffers` INT NOT NULL, | |
`available` VARCHAR(255) NOT NULL, | |
`barcode` VARCHAR(255) NULL, | |
`categoryId` INT NULL, | |
`currencyId` INT NULL, | |
`delivery` INT NULL, | |
`description` TEXT NULL, | |
`id` INT NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="slider"> | |
<div class="slide">your content</div> | |
<div class="slide">your content</div> | |
<div class="slide">your content</div> | |
<div> | |
<h1>ignore me</h1> | |
</div> | |
</div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
preg_replace("/http:\/\/.*?\//", "", $string); | |
preg_replace("@^https?://[^/]+/@", "", $string); | |
//delete all attribute html | |
preg_replace("#(</?\w+)(?:\s(?:[^<>/]|/[^<>])*)?(/?>)#ui", '$1$2', $html); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//поиск строки, где нет title= | |
<a (?![^>]*title=".+?").*?\/> | |
// preg_replace("#(</?\w+)(?:\s(?:[^<>/]|/[^<>])*)?(/?>)#ui", '$1$2', $html); | |
// \w+(?<!href|title|alt|height|width|src)=".+?" | |
// <([a-z][a-z0-9]*)(?:[^>]*(\shref=['\"][^'\"]*['\"]))?[^>]*?(\/?)> <$1$2$3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: #1B2B34; | |
font-size: 62.5%; | |
font-family: sans-serif; | |
color: #00273B; | |
} | |
.app-cont { | |
display: flex; | |
justify-content: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Validator::extend('max_mb', function($attribute, $value, $parameters, $validator) { | |
if ( $value instanceof UploadedFile && ! $value->isValid() ) { | |
return false; | |
} | |
// If call getSize()/1024/1024 on $value here it'll be numeric and not | |
// get divided by 1024 once in the Validator::getSize() method. | |
$megabytes = $value->getSize() / 1024 / 1024; | |
return $megabytes <= $parameters[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="error">{ $error }}</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Compare all values by a json_encode | |
$diff = array_diff(array_map('json_encode', $array1), array_map('json_encode', $array2)); | |
// Json decode the result | |
$diff = array_map('json_decode', $diff); |