473,796 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing a file with contents

Hi all

I have made some pages where PHP produces a menu and gets the
contents from separate files. It works okay. But something I read
made me wonder if there smarter ways to access the content file.

At present I use include($conten t). Now I realize that this means
that the conten file is PHP-parsed. I use that in some cases so I
probably won't change it.

If however I only needed to get the text and send it directly to
the browser, is it true then that just I can use

<? readfile($conte nts); ?>

or

<? file($contents) ;
some_smart_way_ of_printing_an_ array();
?>

Can I trust that readfile() will send the contents to the browser
without a specific print() command?

I read a note about the new version of file_get_conten ts() not
being very fast (since it got binarysafe). Do others agree with
this?

I did not see any particular difference in speed when I tried
readfile() instead of include(). Does it matter?

--
Bertel, Denmark
Jul 18 '05 #1
0 1107

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3595
by: Generic Usenet Account | last post by:
I am trying to create a Java application that reads a list of URLs from a file and stores their contents on the local file system. I have succeeded in accessing normal websites, but I am unable to access the secured websites (using the HTTPS protocol) using this approach. I would greatly appreciate if someone could suggest a way out. I have looked at the HttpsURLConnection class, but unfortunately this class is abstract.
4
3783
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For testing purposes, the secure place is setup on the client machine. The client (window app) calls the web service (on a different machine) and connects successfully to the web service. However, when client calls a method that copies the file from...
3
2359
by: nkrisraj | last post by:
Hi, I have a following structure: typedef struct { RateData rdr; int RateID; char RateBalance; } RateInfo;
8
3022
by: nkrisraj | last post by:
Hi, I have a following structure: typedef struct { RateData rdr; int RateID; char RateBalance; } RateInfo;
0
12089
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the likelihood of CRM success from less than 20 percent to 60 percent. WHITEPAPER :
5
2404
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the correct value. Regardless what I set the variable to, the value that is returned for a long is always the same value. What's going on...can anyone help me? A short version of the code follows:
5
1637
by: keirnna | last post by:
I am trying to access a file with perl and use substitution on that files contents and print the result of that substitution. I also need the the file I am accessing to be input on the command line like this: keirnna$ perl_script.pl file.txt Here is what I have so far: #!/usr/bin/perl -w open(INPUT, "+<", "/pretend/path/file.txt") or die "Couldn't open file..txt for reading: $!\n";
1
1456
by: Jerim79 | last post by:
Probably an incredibly simple answer, but I can't seem to phrase it so a search engine can understand it. I have a php script with a simple include: include("/include_this.php") I need to edit this so it accesses the file from another server. I have tried: include("http://192.168.1.1/include_this.php:)
3
1475
by: FerrisUML | last post by:
Im writing a small web application and what I'd like to do is open a file, read the contents into memory and then close the file as fast as I can to free up the file for the next user. Once the file is loaded into memory and subsequently closed, i would use the contents of the file (now loaded into memory) to perform some quick processing. Any idea how best to do this? Thanks in advance for your help!
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.