[PHP] undefined offset bad argument

2002-08-15 Thread victor

I get this error:

Notice: Undefined offset: 1 in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

Warning: Bad arguments to implode() in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
Error 5

For this code:

?php 

$file_name = $page_name.$ext
or die ('Error 2');

$file = file($path.$file_name)
or die ('Error 3');

$str = implode(' ', $file)
or die ('Error 4');

// Original first tag
//div class=Section1
// Original last tag
///div

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);
$everything_between_divs=$regs[1];

$good = implode(' ', $everything_between_divs)
or die ('Error 5');

$clean = ereg_replace(o:p/o:p,   , $regs[1]);

echo $clean;

?

there might be something wrong with the reg exptession. Or the
variables?

Please help, thanks

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] undefined offset bad argument

2002-08-15 Thread Jason Wong

On Friday 16 August 2002 03:14, [EMAIL PROTECTED] wrote:
 I get this error:

 Notice: Undefined offset: 1 in
 /home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

Which is line 104?


 Warning: Bad arguments to implode() in
 /home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
 Error 5

Ditto.

Use print_r() to display your key variables at strategic points in your code 
to verify that they contain what you expect.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Actors will happen even in the best-regulated families.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php