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
composer create-project laravel/laravel="8.*" lara8 |
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
{ | |
"fa": { | |
"CD5C5C": "جگری", | |
"F08080": "بژ تیره", | |
"FA8072": "حنایی روشن", | |
"E9967A": "قهوهای حنایی", | |
"FFA07A": "نارنجی کرم", | |
"FF0000": "قرمز", | |
"DC143C": "زرشکی", | |
"B22222": "شرابی", |
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 | |
namespace app\controllers; | |
use Yii; | |
use yii\console\controllers\MigrateController; | |
class ConsoleController extends Controller | |
{ | |
public function actionMigrate() |
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 validateNationalCode($NationalCode) | |
{ | |
$NationalCode = preg_replace("/[^0-9]/", '', $NationalCode); | |
$notNationalCode = [ | |
"1111111111", | |
"2222222222", | |
"3333333333", | |
"4444444444", | |
"5555555555", |
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
{ | |
"AD": { | |
"id": "AD", | |
"name": "Andorra", | |
"level": 1, | |
"parent_id": null, | |
"title": "" | |
}, | |
"AE": { | |
"id": "AE", |
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 | |
//multiple delimiters in explode without using regex | |
function iexplode($delimiters, $string, $limit = PHP_INT_MAX) | |
{ | |
if (!is_array($delimiters)) | |
{ | |
$delimiters = [$delimiters]; | |
} | |
$del = reset($delimiters); |
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 | |
Yii::$app->db->createCommand(" | |
INSERT INTO `post_static` (`type`,`value`,`isbn`,`vol`,`book`) (SELECT `type`,`value`,`isbn`,COUNT(`id`) as cnt,1 as book FROM `post_abstract` GROUP BY `type`,`value`,`isbn` HAVING SUM(`static`)>0) | |
ON DUPLICATE KEY UPDATE | |
`vol`=VALUES(`vol`), | |
`book`=1 | |
")->execute(); | |
?> |
NewerOlder