array_key_exists
Intervention/image
Supported Versions: PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8
Checks if the given key or index exists in the array
Alias
key_exists
array_key_exists
(
string
|
int $key
, array
$array
):
bool
$pattern
=
"/^data:(?:image\/[a-zA-Z\-\.]+)(?:charset=\".+\")?;base64,(?P<data>.+)$/"
;
preg_match
(
$pattern
,
str_replace
([
"\n"
,
"\r"
],
''
,
$data_url
),
$matches
);
if (
is_array
(
$matches
) &&
array_key_exists
(
'data'
,
$matches
)) {
return
base64_decode
(
$matches
[
'data'
]);
}
src/Intervention/Image/AbstractDecoder.php
public function
required
()
{
if ( !
array_key_exists
(
$this
->
key
,
$this
->
command
->
arguments
)) {
throw new
InvalidArgumentException
(
sprintf
(
"Missing argument %d for %s"
,
$this
->
key
+
1
,
$this
->
getCommandName
())
);
src/Intervention/Image/Commands/Argument.php
$data
= @
exif_read_data
(
$stream
);
if (!
is_null
(
$key
) &&
is_array
(
$data
)) {
$data
=
array_key_exists
(
$key
,
$data
) ?
$data
[
$key
] :
false
;
}
} catch (
\Exception $e
) {
src/Intervention/Image/Commands/ExifCommand.php
$data
= [];
if (
array_key_exists
(
'APP13'
,
$info
)) {
$iptc
=
iptcparse
(
$info
[
'APP13'
]);
if (
is_array
(
$iptc
)) {
src/Intervention/Image/Commands/IptcCommand.php
}
if (!
is_null
(
$key
) &&
is_array
(
$data
)) {
$data
=
array_key_exists
(
$key
,
$data
) ?
$data
[
$key
] :
false
;
}
$this
->
setOutput
(
$data
);
src/Intervention/Image/Commands/IptcCommand.php
public function
setFileInfoFromPath
(
$path
)
{
$info
=
pathinfo
(
$path
);
$this
->
dirname
=
array_key_exists
(
'dirname'
,
$info
) ?
$info
[
'dirname'
] :
null
;
$this
->
basename
=
array_key_exists
(
'basename'
,
$info
) ?
$info
[
'basename'
] :
null
;
$this
->
extension
=
array_key_exists
(
'extension'
,
$info
) ?
$info
[
'extension'
] :
null
;
$this
->
filename
=
array_key_exists
(
'filename'
,
$info
) ?
$info
[
'filename'
] :
null
;
src/Intervention/Image/File.php
{
$info
=
pathinfo
(
$path
);
$this
->
dirname
=
array_key_exists
(
'dirname'
,
$info
) ?
$info
[
'dirname'
] :
null
;
$this
->
basename
=
array_key_exists
(
'basename'
,
$info
) ?
$info
[
'basename'
] :
null
;
$this
->
extension
=
array_key_exists
(
'extension'
,
$info
) ?
$info
[
'extension'
] :
null
;
$this
->
filename
=
array_key_exists
(
'filename'
,
$info
) ?
$info
[
'filename'
] :
null
;
src/Intervention/Image/File.php
$info
=
pathinfo
(
$path
);
$this
->
dirname
=
array_key_exists
(
'dirname'
,
$info
) ?
$info
[
'dirname'
] :
null
;
$this
->
basename
=
array_key_exists
(
'basename'
,
$info
) ?
$info
[
'basename'
] :
null
;
$this
->
extension
=
array_key_exists
(
'extension'
,
$info
) ?
$info
[
'extension'
] :
null
;
$this
->
filename
=
array_key_exists
(
'filename'
,
$info
) ?
$info
[
'filename'
] :
null
;
if (
file_exists
(
$path
) &&
is_file
(
$path
)) {
src/Intervention/Image/File.php
$this
->
dirname
=
array_key_exists
(
'dirname'
,
$info
) ?
$info
[
'dirname'
] :
null
;
$this
->
basename
=
array_key_exists
(
'basename'
,
$info
) ?
$info
[
'basename'
] :
null
;
$this
->
extension
=
array_key_exists
(
'extension'
,
$info
) ?
$info
[
'extension'
] :
null
;
$this
->
filename
=
array_key_exists
(
'filename'
,
$info
) ?
$info
[
'filename'
] :
null
;
if (
file_exists
(
$path
) &&
is_file
(
$path
)) {
$this
->
mime
=
finfo_file
(
finfo_open
(
FILEINFO_MIME_TYPE
),
$path
);
src/Intervention/Image/File.php
private function
backupExists
(
$name
)
{
return
array_key_exists
(
$name
,
$this
->
backups
);
}
src/Intervention/Image/Image.php