php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28185 function request: array_get
Submitted: 2004-04-27 17:45 UTC Modified: 2004-04-27 21:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mail at spybreak dot de Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.4 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mail at spybreak dot de
New email:
PHP Version: OS:

 

 [2004-04-27 17:45 UTC] mail at spybreak dot de
Description:
------------
I think this could be a useful function in some cases. It's !really! basic but I need it pretty often (ok not thaaat often).

Why did I request it? It saves me some lines plus a variable.

Reproduce code:
---------------
//with function

function array_get($array, $key)
{
	return $array[$key];
}

$img = 'someimg.png';

echo '<img src="'.$img.'" '.array_get(getimagesize($img),3).'>

//without

$img = 'someimg.png';
$widthheight = getimagesize($img);
$widthheight = $widthheight[3];

echo '<img src="'.$img.'" '.$widthheight.'>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-27 21:15 UTC] derick@php.net
This is not something we will add, as you demonstrated it's easy to use in user space. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 29 11:01:28 2025 UTC