Showing posts with label unset(). Show all posts
Showing posts with label unset(). Show all posts

PHP : Removes a particular value from an array

In this tutorial learn how to remove value from an array (numeric or associative) in php using unset() method.

 function removearrayValue($array, $value)
    {
        $IsNumericArray = true;
        foreach ($array as $key => $item) {
            if ($item === $value) {
                if (!is_int($key)) {
                    $IsNumericArray = false;
                }
                unset($array[$key]);
            }
        }
        if ($IsNumericArray) {
            $array = array_values($array);
        }

        return $array;
    }

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...