{['чапаева $', '424004']}*5
['чапаева 1', '424004'],
['чапаева 2', '424004'],
['чапаева 3', '424004'],
['чапаева 4', '424004'],
['чапаева 5', '424004'],
{['чапаева $@3', '424004'],}*5
['чапаева 3', '424004'],
['чапаева 4', '424004'],
['чапаева 5', '424004'],
['чапаева 6', '424004'],
['чапаева 7', '424004'],
str.split(';').pop()
// или
str.replace(/.*;/, '')
// или
str.match(/;(.*)/)[1]
// или
/[^;]+$/.exec(str).shift()
// или
str.slice(str.lastIndexOf(';') + 1)
// или
[...str].reduce((acc, n) => n === ';' ? '' : acc + n)
// или
Array.from(str).filter((n, i, a) => !a.includes(';', i)).join('')
json_encode(mixed $value, JSON_PRETTY_PRINT);
$query = "SELECT * FROM news WHERE id=?";
$stmt = $conn->prepare($query);
$stmt->bind_param("s", $_GET['id']);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
GET https://www.googleapis.com/youtube/v3/videos?id=sTPtBvcYkO8&key=YOUR_API_KEY&part=statistics
{
"kind": "youtube#videoListResponse",
"etag": "\"kjEFmP90GvrCl8BObMQtGoRfgaQ/XN5YXMZGQaruwTWTekZu7fQthdY\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"kjEFmP90GvrCl8BObMQtGoRfgaQ/QbzZs_aBNpzkZJxTVM7YgQeEY3g\"",
"id": "sTPtBvcYkO8",
"statistics": {
"viewCount": "3215321",
"likeCount": "17003",
"dislikeCount": "263",
"favoriteCount": "0",
"commentCount": "621"
}
}
]
}
add_action( 'template_redirect', function(){
if ( is_attachment() ) {
global $post;
if ( !empty($post->post_parent) ) {
wp_redirect( esc_url( get_permalink( $post->post_parent ) ), 301 );
}
wp_redirect( esc_url( home_url( '/' ) ), 301 );
}
});