Jump to content

Offset no contained??


xProteuSx

Recommended Posts

I have an array, $old_array, that looks like this (each line is a different index):

 

1|1|0|20|0|0

1|2|0|20|0|0

1|3|0|20|0|0

1|4|0|20|0|0

1|5|0|20|0|0

1|6|0|20|0|0

1|7|0|20|0|0

33|3|0|15|0|0

33|4|0|15|0|0

33|5|0|15|0|0

34|1|0|15|0|0

34|2|3|15|0|0

34|3|2|15|0|0

34|4|3|15|0|0

34|5|0|15|0|0

34|6|2|15|0|0

34|7|0|15|0|0

 

It is an array of strings, which are exploded to create other arrays.

 

Anyways, then I have a foreach loop like this:

 

foreach($old_array as $val)

                {

                $check = substr($val, 0, strpos( $val,'|',strpos($val,'|')+1));

                $array_temp[ $check ] = TRUE;

                }

 

I am getting this error (ONLY IN INTERNET EXPLORER!):

 

Warning: strpos() [function.strpos]: Offset not contained in string in /home/pgagnon/public_html/chores_uni.html on line 131

 

Line 131 is this one:

 

$check = substr($val, 0, strpos( $val,'|',strpos($val,'|')+1));

 

Why does this work in Firefox, Opera, Safari, Chrome, but not IE??  Microsoft can eat shit until it dies!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.