This file contains 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
```SQL | |
create schema test_1 collate utf8mb4_general_ci; | |
use test_1; | |
create table estimate | |
( | |
estimate_id int not null | |
primary key, | |
customer_id int null, | |
invoice_id int null, | |
host_id int null, |
This file contains 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
function get_navigation_data($navigation_name) { | |
$locations = get_nav_menu_locations(); | |
$menu = wp_get_nav_menu_object($locations[$navigation_name]); | |
$menu_items = wp_get_nav_menu_items($menu->term_id); | |
$result = []; | |
foreach($menu_items as $key => $item) { | |
if(array_key_exists((string)$item->menu_item_parent,$result)) { | |
$result[$item->menu_item_parent]['children'][] = ['title'=>$item->title,'url'=>$item->url]; |
This file contains 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
public function testRowArrayConvert() { | |
$ar = [ | |
'a' => ['123','123','123','123'], | |
'b' => ['123','123','123','123'], | |
'c' => ['123','','123','123'], | |
'd' => ['123','123',null,'123'], | |
'e' => ['123','123','','123'], | |
'f' => ['','123','123','123'], | |
]; |
This file contains 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
public function testRowArrayConvert() { | |
$ar = [ | |
'a' => ['123','123','123','123'], | |
'b' => ['123','123','123','123'], | |
'c' => ['123','','123','123'], | |
'd' => ['123','123',null,'123'], | |
'e' => ['123','123','','123'], | |
'f' => ['','123','123','123'], | |
]; |
This file contains 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 | |
$箱 = []; | |
$箱[] = '人形'; | |
$箱[] = 'プラレール'; | |
$箱[] = 'トミカ'; | |
var_dump($箱); | |
$タンス = []; |
This file contains 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
<!-- うごかない --> | |
<html> | |
<head> | |
<script> | |
jQuery(function(){ | |
alert("age") | |
}); | |
</scirpt> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<meta charset="utf-8" /> |
This file contains 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
jQuery('#form').after('<div>message</div>') | |
jQuery('form').after('<div>message</div>') | |
jQuery('.form').after('<div>message</div>') |
This file contains 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
var event = { | |
page_a : function() { | |
jQuery("#b").on("click",function(){alert("mogekiti")}) | |
}, | |
} | |
This file contains 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
$image = getFirstImage(get_the_content()); | |
if(!empty($image)) { | |
$doc = new DOMDocument(); | |
@$doc->loadHTML($image); | |
$finder = new DomXPath($doc); | |
$ele = $finder->query("//*[contains(@class, 'alignnone')]")->item(0)->removeAttribute; // <- こいつがエラーするんだ | |
var_dump($ele); | |
} |
This file contains 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
function getFirstImage($content) { | |
$pattern = "/<img.*?src\s*=\s*[\"|\'](.*?)[\"|\'].*?>/i"; | |
preg_match($pattern,$content,$images); | |
if(empty($images)) { | |
$result = false; | |
} else { | |
$result = $images[0]; | |
} |
NewerOlder