Request URL:http://chehl.ru/page/2/
Request Method:GET
Status Code:404 Not Found
global $product;
$meta_values = get_post_meta($product->post->ID);
if(!$meta_values['wfg_single_gift_enabled']) {
$gift_id = $meta_values["_wfg_single_gift_products"];
$session_data = (unserialize($gift_id[0]));
echo $session_data[0];
}
<?php namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class AjaxController extends Controller {
public function request(Request $request) {
if($request->ajax()){
$param = $request->input('param');
echo json_encode($param);
}
}
}
Route::post('ajax/request', 'AjaxController@request');
jQuery.ajax({
url: location.origin + '/ajax/request',
async: false,
type: 'POST',
data: {'param': '32'},
dataType: 'json',
success: function(data) {
alert(data);
},
error: function() {
alert('Ошибка');
}
});
знаю что есть mb_substr, но не буду же я везде менять эту функцию, так?Ну, если не будете - mbstring.func_overload.
//div[contains(@class, "some-class")]/div/span[1]/following-sibling::text()
//div[contains(@class, "some-class")]/div/text()[normalize-space()]
'{music}' => $settings['music'] ? '<embed src="/new.mp3" volume="-300" hidden="true" autostart="true">' : '',
$user = User::where(['email' => 'superman@gmail.com'])->first();
$.post('/index.php',{session_mid:response.session.mid});
$session_mid = $_POST['session_mid'];
convert input.png -fill white -fuzz 10% +opaque "#FF0000" result.png
function getElementByPath(array &$arr, array $path) {
$el = $arr[array_shift($path)];
if (count($path) === 0) {
return $el;
}
return getElementByPath($el, $path);
}
$arr = array(
'one' => array(
'two' => array(
'three' => 'stroka'
)
)
);
$path = array(
'one',
'two',
'three'
);
$el = getElementByPath($arr, $path);
var_dump($el); // ---> 'stroka'
// Последний параметр значение, если элемент не найден
function getElementByPath(array &$arr, array $path, $initial = null) {
return array_reduce($path, function (&$res, $key) use (&$initial) {
return is_array($res) && isset($res[$key]) ? $res[$key] : $initial;
}, $arr);
}