Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with function file_get_contents($file)
Old 05-28-2005, 02:22 AM Help with function file_get_contents($file)
Experienced Talker

Posts: 32
Trades: 0
PHP Code:

function file_get_contents($file)
{
    
$file file($file);
    return !
$file false implode(''$file);
}

$hostdata file_get_contents("http.conf");
$datasplitsplit("\n"$hostdata); 
I am trying to read the data froim a file and the example presented below is a line in the file that is not working bacially when ever i try to get aline that has <> in it, it doesnt work

I am usig the function listed to get the data from a file however when ever the function reaches variable that has < or > it skipps over the data with in those two backets. so let say i have

# See <URL:http://httpd.apache.org/docs-2.0/> for detailed information about

it will output

# See for detailed information about

and if i have

# See <URL:http://httpd.apache.org/docs-2.0/ for detailed information about

it will output

# See

As you notice it seem like when ever anything is within the brackers <> it totally cuts it out of the string.

Please i am asking if someone can give me a suggestion of how to fix this problem thank you very much.

Last edited by rcubes85; 05-28-2005 at 03:25 AM..
rcubes85 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-28-2005, 02:39 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
I guess that if you right click your browser and select View Source then you will see that it works quite fine.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-28-2005, 03:25 AM
Experienced Talker

Posts: 32
Trades: 0
what do you mean ?
rcubes85 is offline
Reply With Quote
View Public Profile
 
Old 05-28-2005, 03:30 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
you have to replace < and > with &lt; and &gt; respectively.

what mtishetsky means is that the part of the line is printed out ... only your browser understands it as HTML code and does not display.

good luck.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-28-2005, 04:08 AM
Experienced Talker

Posts: 32
Trades: 0
hahahaha how did i miss that thank alot guys. what i wanted to do in the end was to write the data to a file when i did that it works fine thanks alot
rcubes85 is offline
Reply With Quote
View Public Profile
 
Old 05-28-2005, 06:12 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
you're welcome rcubes85, not seeing the simplest solution happens a lot to me too.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with function file_get_contents($file)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21340 seconds with 12 queries