This is a discussion on $type ["extension"]; within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, refering to: $type = pathinfo($filename); $ext = $type ["extension"]; complains: Notice: Undefined index: extension in C:\Program Files\...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
refering to: $type = pathinfo($filename); $ext = $type ["extension"]; complains: Notice: Undefined index: extension in C:\Program Files\Apache Group\Apache2\htdocs\titImage\imgSrc.php on line 61 -- Thanks for your attention. Jean Pierre Daviau -- Easyphp1.8 Apache1.3.24 DEVC++, borland 5.5 windows Xp asus p4 s533/333/133 Intel(R) Celeron (R) CPU 2.00 GHz http://www.jeanpierredaviau.com |
|
|||
|
Am 30.03.2006 21:19 schrieb Jean Pierre Daviau:
> refering to: > $type = pathinfo($filename); > $ext = $type ["extension"]; Seems to be ok. > complains: > Notice: Undefined index: extension in C:\Program Files\Apache > Group\Apache2\htdocs\titImage\imgSrc.php on line 61 Are you shure, that your file exists? Do you use error_reporting(E_ALL)? |
|
|||
|
"Johannes Wienke" <spam@semipol.de> a écrit dans le message de news: 495nflFn2i9iU2@news.dfncis.de... > Am 31.03.2006 17:15 schrieb Jean Pierre Daviau: >>>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)? >> >> Yes >> > > What about var_dump($type)? $type = pathinfo($filename); $ext = @$type ["extension"]; ..............^ good enough I used E_all instead of E_PARSE for better coding .I corrected 3 errors that way. |
|
|||
|
Am 01.04.2006 21:48 schrieb Jean Pierre Daviau:
> "Johannes Wienke" <spam@semipol.de> a écrit dans le message de news: > 495nflFn2i9iU2@news.dfncis.de... >> Am 31.03.2006 17:15 schrieb Jean Pierre Daviau: >>>>> Are you sure, that your file exists? Do you use error_reporting(E_ALL)? >>> Yes >>> >> What about var_dump($type)? > > $type = pathinfo($filename); > > $ext = @$type ["extension"]; > .............^ > > good enough What's that? I don't see any difference then suppressing errors, what is nearly allways a bad idea. > I used E_all instead of E_PARSE for better coding .I corrected 3 errors > that way. Take a look above. That's exactly what I said... |
|
|||
|
Hm, Guys :))
maybe $filename doesn't have an extension? pathinfo cretes only things that can be found... <?php $type=pathinfo($filename); if ( isset($type['extension']) ) { //extension set } else { // extension not set } ?> or whatever... |