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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 14:01:32 2024 UTC