FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » r/w internal array pointer
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: r/w internal array pointer [message #176335 is a reply to message #176331] Fri, 23 December 2011 09:40 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 22/12/2011 23:09, Olaf S. escribió/wrote:
> Am 22.12.2011 19:08, schrieb oldyork90:
>>
>> There are reset() and end() functions for array pointer P
>> manipulation. Is there a way to set or read it directly? P = 3?
>>
>>
>> loop
>> next($a);
>> break on some count
>>
>> seems to be the only way to do it.
>>
>> Thank you.
>
>
> $x = $a[3];

The square bracket operator does not seem to alter the array pointer:

<?php

$foo = range(0, 99);

var_dump(next($foo));
var_dump(next($foo));

$foo[50];

var_dump(next($foo));

?>

.... prints this:

int(1)
int(2)
int(3)


Array pointers are not very practical but I suppose the are not widely
used anyway.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: anyone know of RTF translator?
Next Topic: width measurements?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 15:22:15 GMT 2024

Total time taken to generate the page: 0.03584 seconds