@@ -157,7 +157,7 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
157
157
if ($ i == $ match_pos ) {
158
158
if ($ i != $ curr_pos ) {
159
159
$ result = trim (substr ($ str_original , $ curr_pos , $ i - $ curr_pos ));
160
- if (strncasecmp ($ result , 'delimiter ' , 9 ) == 0 && (strlen ($ result ) == 9 || FALSE !== strpos(" \t" , $ result{ 9 } ))) {
160
+ if (strncasecmp ($ result , 'delimiter ' , 9 ) == 0 && (strlen ($ result ) == 9 || FALSE !== strpos (" \t" , $ result[ 9 ] ))) {
161
161
$ delim = trim (strtolower (substr ($ result , 10 )));
162
162
if ("" == $ delim ) {
163
163
$ delim = "; " ;
@@ -177,23 +177,23 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
177
177
if (FALSE !== $ result ) {
178
178
break ;
179
179
}
180
- } else if ($ str{ $ i } == "' " ) {
180
+ } else if ($ str[ $ i ] == "' " ) {
181
181
for ($ j = $ i + 1 ; $ j < $ len ; ++$ j ) {
182
- if ($ str{ $ j } == "\\" ) ++$ j ;
183
- else if ($ str{ $ j } == "' " ) break;
182
+ if ($ str[ $ j ] == "\\" ) ++$ j ;
183
+ else if ($ str[ $ j ] == "' " ) break ;
184
184
}
185
185
$ i = $ j ;
186
- } else if ($ str{ $ i } == "\"" ) {
186
+ } else if ($ str[ $ i ] == "\"" ) {
187
187
for ($ j = $ i + 1 ; $ j < $ len ; ++$ j ) {
188
- if ($ str{ $ j } == "\\" ) ++$ j ;
189
- else if ($ str{ $ j } == "\"" ) break;
188
+ if ($ str[ $ j ] == "\\" ) ++$ j ;
189
+ else if ($ str[ $ j ] == "\"" ) break ;
190
190
}
191
191
$ i = $ j ;
192
- } else if ($ i < $ len - 1 && $ str{ $ i } == "/ " && $ str{ $ i + 1 } == "* " ) {
192
+ } else if ($ i < $ len - 1 && $ str[ $ i ] == "/ " && $ str[ $ i + 1 ] == "* " ) {
193
193
$ j = $ i + 2 ;
194
194
while ($ j ) {
195
195
$ j = strpos ($ str , "*/ " , $ j );
196
- if (!$ j || $ str{ $ j - 1 } != "\\" ) {
196
+ if (!$ j || $ str[ $ j - 1 ] != "\\" ) {
197
197
break ;
198
198
}
199
199
++$ j ;
@@ -202,26 +202,26 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
202
202
break ;
203
203
}
204
204
$ i = $ j + 1 ;
205
- } else if ($ str{ $ i } == "# " ) {
205
+ } else if ($ str[ $ i ] == "# " ) {
206
206
$ j = strpos ($ str , "\n" , $ i + 1 ) or strpos ($ str , "\r" , $ i + 1 );
207
207
if (!$ j ) {
208
208
break ;
209
209
}
210
210
$ i = $ j ;
211
- } else if ($ i < $ len - 2 && $ str{ $ i } == "- " && $ str{ $ i + 1 } == "- " && FALSE !== strpos (" \t" , $ str{ $ i + 2 } )) {
211
+ } else if ($ i < $ len - 2 && $ str[ $ i ] == "- " && $ str[ $ i + 1 ] == "- " && FALSE !== strpos (" \t" , $ str[ $ i + 2 ] )) {
212
212
$ j = strpos ($ str , "\n" , $ i + 3 ) or strpos ($ str , "\r" , $ i + 1 );
213
213
if (!$ j ) {
214
214
break ;
215
215
}
216
216
$ i = $ j ;
217
- } else if ($ str{ $ i } == "\\" ) {
217
+ } else if ($ str[ $ i ] == "\\" ) {
218
218
++$ i ;
219
219
}
220
220
}
221
221
222
222
if (FALSE === $ result && $ curr_pos < $ len ) {
223
223
$ result = trim (substr ($ str_original , $ curr_pos ));
224
- if (strncasecmp ($ result , 'delimiter ' , 9 ) == 0 && (strlen ($ result ) == 9 || FALSE !== strpos (" \t" , $ result{ 9 } ))) {
224
+ if (strncasecmp ($ result , 'delimiter ' , 9 ) == 0 && (strlen ($ result ) == 9 || FALSE !== strpos (" \t" , $ result[ 9 ] ))) {
225
225
$ delim = trim (strtolower (substr ($ result , 10 )));
226
226
if ("" == $ delim ) {
227
227
$ delim = "; " ;
0 commit comments