Skip to content

Instantly share code, notes, and snippets.

View calevano's full-sized avatar
🍕
eating pizza and being happy making code.

Carlos Levano calevano

🍕
eating pizza and being happy making code.
View GitHub Profile
@calevano
calevano / order_array_to_value
Created August 19, 2019 18:13
Array order to value
$new = [
[
'hashtag' => 'a7e87329b5eab8578f4f1098a152d6f4',
'title' => 'Flower',
'order' => 3,
],
[
'hashtag' => 'b24ce0cd392a5b0b8dedc66c25213594',
'title' => 'Free',
@calevano
calevano / array_multidimensional.php
Created August 19, 2019 23:51
search value in array multidimensional
$key = array_search('100', array_column($userdb, 'uid'));
@calevano
calevano / php mb_ucfirst
Created March 23, 2020 17:44
Perform a word ucfirst in php with special characters to UTF-8. Example: área to Área
if (!function_exists('mb_ucfirst')) {
/**
* @param $str
* @param string $encoding
* @param bool $lower_str_end
* @return string
*/
function mb_ucfirst($str, $encoding = "UTF-8", $lower_str_end = false)
{
$first_letter = mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding);