From: pgreviews at gmail dot com Operating system: Linux PHP version: 5.3.1 PHP Bug Type: Feature/Change Request Bug description: A suggestion about arrays
Description: ------------ Hey, I have a feature suggestion that would be used with array. You'd simply set your array variable, use a new function (called, say, arygrb, for arraygrab?) and it would echo a part of the array, where you tell it to start and end, that can go across the commas and such. Something like: <?php $array = array("first,"second","third","fourth","fifth"); echo arygrb($array("first","third")<br />); ?> Which would echo: first<br />second<br />third everything up from 'first' to 'third', replacing the "," with <br /> Of course, you could just echo "$array[0] $array[1] $array[2]" but what if it's user input that's in the array? What if you don't know what is in the array, and you're searching it? I think this would be handy. Hope you think so too :) -PG Reproduce code: --------------- --- >From manual page: faq --- <?php $array = array("first,"second","third","fourth","fifth"); echo $array; //Would echo "Array", not good, unless you put $array[1]... echo arygrb($array("first","third")<br />); //Would echo 'first<br />second<br />third, the <br />s actually being line breaks ?> -- Edit bug report at http://bugs.php.net/?id=50304&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50304&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50304&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50304&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50304&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50304&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50304&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50304&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50304&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50304&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50304&r=support Expected behavior: http://bugs.php.net/fix.php?id=50304&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50304&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50304&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50304&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50304&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50304&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50304&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50304&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50304&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50304&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50304&r=mysqlcfg