try catch error


Posted on 16th Feb 2014 07:03 pm by admin

I have been trying try catch but, I can't get it to work. The code opens a non existing file called "a"

Code: private function fileOpenMethod($filePath, $numberOfLines,$header,$replaceHeader){
try{
Did you know?Explore Trending and Topic pages for more stories like this.
$file = file( $filePath);
}catch(file $e){
$e= "the flie path does not work"; //. $e->getMessage();
}

return $e;
}
I am getting an error message on the page but not the one that am trying to generate
Code: Warning: file(a) [function.file]: failed to open stream: No such file or directory in /home/public_html/_Doc/StripFileClass.php on line 15

I am sure it is simple but I am new to try and catch and it is a learning curve blah blah blah.
Can anyone see what I am doing wrong =)
No comments posted yet

Your Answer:

Login to answer
320 Like 17 Dislike
Previous forums Next forums
Other forums

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

very easy question about SQL info
Hello,
I think that I have a very easy question.
I know how to create a form using php SQL and

Problem displaying "scraped" XML data
I'm basicly having trouble displaying XML data scraped from an URL using cURL.

What the code

Php WordPress help
I am writing the following code for making a plugin

<?php
header("Content-Type

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

ALV List Display to point to another report on Double Click
Hi,

I want my ALV List Display to point to another report on Double Click on its line ite

Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order t

CHMOD script
Hi,

I need a script to read all files in a folder and set to 777.

Can anyone help out

IS Retail & Manufacturing
Hi

Can IS Retail and Manufacturing activities be done in same instance ie. in same client

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash