Re: Mid$ Function Alternative
- From: "spaceman33" <bargarian@xxxxxxxxx>
- Date: Sun, 14 Aug 2005 19:16:17 +0000 (UTC)
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
>
>
>
>
>
.
- References:
- Mid$ Function Alternative
- From: spaceman33
- Re: Mid$ Function Alternative
- From: Janwillem Borleffs
- Mid$ Function Alternative
- Prev by Date: Re: Php with JavaScript
- Next by Date: Re: Alternative ways to send email via php?
- Previous by thread: Re: Mid$ Function Alternative
- Next by thread: inserting multiple lines from one form
- Index(es):
Relevant Pages
|