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
Switch to threaded view of this topic Create a new topic Submit Reply
r/w internal array pointer [message #176330] Thu, 22 December 2011 18:08 Go to next message
oldyork90 is currently offline  oldyork90
Messages: 9
Registered: December 2011
Karma: 0
Junior Member
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.
Re: r/w internal array pointer [message #176331 is a reply to message #176330] Thu, 22 December 2011 22:09 Go to previous messageGo to next message
Olaf S. is currently offline  Olaf S.
Messages: 10
Registered: December 2011
Karma: 0
Junior Member
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];
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: 0
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
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: anyone know of RTF translator?
Next Topic: width measurements?
Goto Forum:
  

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

Current Time: Sat Nov 30 01:07:16 GMT 2024

Total time taken to generate the page: 0.02114 seconds