Re: Mid$ Function Alternative




Thank you, got this example to work.

Cheers
"Janwillem Borleffs" <jw@xxxxxxxxxxxxx> wrote in message
news:42fdc1b0$0$9253$dbd4f001@xxxxxxxxxxxxxxxxxx
>
> spaceman33 wrote:
>> I am looking for a PHP equivalent of the common Mid$ command, found
>> in VB etc.
>>
>> eg, I have $page containing a lot of text, $a will be the for next
>> variable, so I am looking for something like:
>>
>> for a=1 to len($page)
>> if mid$(page,a,4)<>"User" then goto 444
>> do some stuff
>> 444
>> next a
>>
>
> Have a look at the substr function (http://www.php.net/substr), e.g.:
>
> for ($i = 0; $i < strlen($page); $i++) {
> if (substr($page, $i, 4) == 'User') {
> // do stuff
> }
> }
>
>
> JW
>
>
>
>
>



.