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
>
>
>
>
>



.



Relevant Pages

  • Re: Mid$ Function Alternative
    ... spaceman33 wrote: ... > I am looking for a PHP equivalent of the common Mid$ command, ...
    (alt.php)
  • Mid$ Function Alternative
    ... but not with much success. ... I am looking for a PHP equivalent of the common Mid$ command, ...
    (alt.php)
  • Re: iTunes questions
    ... Its time Apple woke up. ... keyboard shortcuts are conspicuously absent. ... they also gave the common actions keyboard equivalents, which is much, ... Every commonly used command or option should have a kb shortcut. ...
    (comp.sys.mac.apps)
  • Re: mode independent UI description language
    ... but without defining ... > would be a common definition for multi-modal interfaces... ... It's a 'text user interface' in that the 'hot-button' ... to execute any command, I 'cord' on the 'text' of the command ...
    (sci.cognitive)
  • Re: Deploying Common Lisp applications
    ... This trick is very common, ... >> bin files use it to select various sets of command line options. ... > This saves disk space at the expense of modularity / maintenance. ...
    (comp.lang.lisp)