...
$login = 123;
$index = array_search( $login, array_column( $config, 'login') );
$key = array_keys( $config )[ $index ];
$value = array_values( $config )[ $index ];
var_dump( [ $key => $value ] );
...
$pass = 123;
array_walk($config, function( &$item, $key, $password ) { if( $item['login'] != $password )
$item = null; }, $pass );
var_dump( array_filter( $config ));
...
SELECT
days,
image,
authorid
FROM
blog
ORDER by
days DESC
LIMIT
10
...
echo substr_count( json_encode( $arr ), "sku stock not changed" );
// или
echo substr_count( serialize( $arr ), "sku stock not changed" );
echo substr_count( strtolower( json_encode( $arr )), "sku stock not changed" );
// или
echo substr_count( strtolower(serialize( $arr )), "sku stock not changed" );
$m_1 = array_flip( ["d", "b", "g", "v", "z", "j", "r", "l", "m", "n", "h", "c", "t", "p", "k", "f", "s"] );
$m_2 = array_flip( ["a", "o", "e", "u", "i"] );
$str = "";
$length = 32;
do{
$str .= array_rand( $m_1 );
$str .= array_rand( $m_2 );
}
while( strlen( $str ) < $length );
echo $str ;
function str_rand($length = 32, $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
{
if (!is_int($length) || $length < 0)
return false;
$characters_length = strlen($characters) - 1;
$string = '';
for ($i = $length; $i > 0; $i--)
$string .= $characters[mt_rand(0, $characters_length)];
return $string;
}