f



php://memory and php://temp

http://php.net/manual/en/wrappers.php.php
per the documentation:  php://memory and php://temp are both listed
under "Allows Appending"

what am I missing / what's the point?

They only seem to work with read/write modes such as
fopen('php://memory','rw');

closing the handle, or trying to open another handle without closing
the first essentially erase the contents... so what's the point of
fopen('php://memory','a') ?
you'll
a) be appending nothing,
b) no way to read what you just wrote?

sure would be nice if you could

$fh = fopen('php://memory', 'w');
fwrite($fh, 'test string');
fclose($fh);

$fh = fopen('php://memory', 'r');
$result = fgets($fh,2048);
fclose($fh);
echo $result;
0
10/13/2010 1:44:28 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

1 Replies
1886 Views

Similar Articles

[PageSpeed] 34

On 10/12/2010 9:44 PM, BKDotCom wrote:
> http://php.net/manual/en/wrappers.php.php
> per the documentation:  php://memory and php://temp are both listed
> under "Allows Appending"
>
> what am I missing / what's the point?
>
> They only seem to work with read/write modes such as
> fopen('php://memory','rw');
>
> closing the handle, or trying to open another handle without closing
> the first essentially erase the contents... so what's the point of
> fopen('php://memory','a') ?
> you'll
> a) be appending nothing,
> b) no way to read what you just wrote?
>
> sure would be nice if you could
>
> $fh = fopen('php://memory', 'w');
> fwrite($fh, 'test string');
> fclose($fh);
>
> $fh = fopen('php://memory', 'r');
> $result = fgets($fh,2048);
> fclose($fh);
> echo $result;

These are temporary "files" - as soon as they are closed, they go away, 
as you note.  So it really doesn't make any sense to open them other 
than for read/write.

Other options are there - but those are just standard options for any 
file.  It doesn't mean you need to use them.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
jstucklex (14659)
10/13/2010 3:06:52 AM
Reply:

Similar Artilces:

PHP Training Institute In Delhi, Live Projects on PHP. Short Term PHP Courses, PHP Scripts, PHP Training with Live Projects.
Vserve Global offers short term PHP: Hypertext Preprocessor Training Course, which is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on over 20 million websites and 1 million web servers. TOPICS:- >> Core PHP Language >> HTML, Cascad...

php outside php (?)
Sounds weird, i know. What i want/wonder is the following: PHP can do the next: <?php if($foo == 'bar') { ?> Ow yeah, foo is bar! <?php }; ?> But how can i do the following: <?php $foo= ?> this is what foo looks like. <?php }; ?> This way i could edit the content of $foo in DW's design-view. I hope it's clear enough for you all to understand... Greetings frizzle. frizzle wrote: > But how can i do the following: > > <?php > > $foo= > > ?> > this is what foo looks like. > &l...

PHP within PHP...
I took over the support of a website that is set up something like this inside one of the pages: include_once("header.php"); <?php //to get the content of the page they do this: $content = mysql_query("select content etc...); echo $content; ?> include_once("footer.php"); I am having problems evaluating any php that is used in the mysql content. Is there a way to get the mysql withing the mysql to run? Thank you for your time, Mandragon On Sep 17, 12:56 pm, Mandrago...@gmail.com wrote: > I took over the support of a website that is set up something li...

php to php obj
Hi All, Is there any tool to convert the .php files into its object files in deploying the files to other's server like java classes are deployed? Thanks in advance --AR John7481 <arjohn7481@hotmail.com> wrote or quoted: > Is there any tool to convert the .php files into its object files in > deploying the files to other's server like java classes are deployed? To what end? Do you want a PHP obfuscator? They tend not to be needed - since the code remains on the server. Do you want a PHP squeezer? Again - since PHP remains on the server that is of reduced importanc...

Best PHP Training | PHP Development Training | PHP Training Institute
Tops Technologies provides php and mysql certification courses in ahmedabad, baroda, surat, Rajkot, Udaipur, Gujarat, india.PHP Training with MySQL is an introductory course in the PHP and MySQL technology. Mysql and php training course, php for beginners, sql training courses, PHP Training courses, php courses, mysql training courses, php mysql course. For More Details :- http://www.tops-int.com ...

Send array from php to php
HI every one I' try to send array from web page to php file but no data are show I'm using session to store data and this is my code //////////////////////////////////////////////////////////////////////// $data = $cart_items; session_register('data'); foreach ($cart_items as $cart_item) { echo "<tr>"; echo " <td><span class='style2'>".$cart_item->name."</span></td>"; echo " <td><span class='style2'>".$cart_item->description."</ span></td>"...

PHP games to learn PHP
Hi, I am learning PHP, but it can be kind of boring. Are there any games where you use PHP programming to play the game? This way you learn how to use PHP and it is fun. Does anybody know? Nick "Nick Mudge" wrote > I am learning PHP, but it can be kind of boring. Are there any games where > you use PHP programming to play the game? This way you learn how to use > PHP and it is fun. Does anybody know? Yes. Write something (a game, for example) in PHP. To make it even more entertaining, you could add a touch of javascript. Ivo "Ivo" <no@thank.you> w...

PHP with Indian PHP Developers
Dear all, If you want to make a PHP web application, or need to <a href="http:// www.virtueinfo.com/php-developers/hire-php-programmers-developers-india.htm">Hire PHP Developer</a>contact a leading <a href="http://www.virtueinfo.com/ php-developers/php-web-development.htm"> PHP Web Development Compnay</ a> <a href="http://www.virtueinfo.com/php-developers/php-web-programming- php-developers-india.htm">Offshore PHP web development India</a> On Thu, 25 Feb 2010 01:37:02 -0800 (PST), Virtue Info wrote: > Dear all, > >...

Tutorial on php (or learning php)
I need to learn php and MySQL quickly to support an app. Realizing experience is the best teacher, and this takes time, does anyone ahve any recommendations on: books tutorials web sites samples to help me get going? Thanks. Hugh Williams and David Lane have written a book called "Web Database Applications with PHP and MySQL'' which you can obtain from Amazon at http://www.amazon.com/exec/obidos/ASIN/0596000413/hughwilliams-20/103-0647779-6796618. This book has its own website at http://www.webdatabasebook.com/. You can also download the code and install it locally. HTH. ...

PHP does not parse .PHP files
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the file. Instead of display the info of PHP, I got the text of the file as: <?php phpinfo(); ?> Why? Thanks Phong Ho wrote: >I have this problem with PHP that someone might be able to help. > >With CLI, I am able to execute my ....

Does PHP need the .php extension ?
Hi guys, When I use PHP I give my file the .php extension. I always wondered if it could be an .htm page with a <script> block that the PHP resides in, the same way you would do JavaScript. If you can do it that way are there any benifits to that method ? Take care, Cyrus "Cyrus D." <satan@invalid.org> writes: > Hi guys, > > When I use PHP I give my file the .php extension. I always wondered if it > could be an .htm page with a <script> block that the PHP resides in, the > same way you would do JavaScript. If you can do it that way are the...

PHP 4 and PHP 5
What is main difference between PHP 4 and PHP 5? Is possible to use object programming apporach with PHP4? Is possible to use Stored Procedures in Oracle with PHP4? Where I can get more informations? Thanks in advance "ablyplus" <ablyplus@yahoo.com> wrote in message news:cr5n6g$5bp$1@ls219.htnet.hr... > What is main difference between PHP 4 and PHP 5? take a look at http://www.zend.com/php5/ > Is possible to use object programming apporach with PHP4? Yes. The new features in PHP 5 are mainly cosmetic (e.g. visibility). With PHP 4 you can define classes with me...

Php constants in php.ini
I am trying to set user_agent = PHP_VERSION in php.ini. In my php.ini the instructions say that you can use constants in the php.ini file. The only constants I can get to work, though, are the error level constants like E_ALL, E_ERROR, E_WARNING, etc., ... Is anyone aware of some sort of trick to getting others to work? (I was thinking it would be nice to have the user agent string used by my Php scripts to use PHP_VERSION in the string.) -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. *****...

php notification through php sdk
Hi there I want to build a e-commerce website similar to wish.com and I have chosen opencast as my framework of choice. Now wish has a feature that when you save a product in wish and if you are logged in with Facebook or gmail all of your friends will get a notification that your friends has saved a item on wish. I want a similar feature on my site Now I know Facebook provide a sdk JavaScript and php and wish might be using something similar but I am using open cart can I open home page or product page in the sdk Thanks On 3/20/2015 7:30 AM, apoorv.kanungo@gmail.com wrote: &g...

Web resources about - php://memory and php://temp - comp.lang.php

Memory - Wikipedia, the free encyclopedia
In psychology , memory is the process in which information is encoded, stored, and retrieved. Encoding allows information from the outside world ...

Read-Only Memory
Read-Only Memory publishes high-quality books and articles that document defining moments in videogame history.

Heavy marijuana use can damage short-term memory, study shows
... have suspected for some time: If you smoke a lot of weed - like a lot of it - it can potentially do permanent damage to your short-term memory. ...

Jian Ghomeshi trial: 1st day wraps after defence questions witness's memory
The first day of Jian Ghomeshi's sexual assault trial has wrapped in a Toronto courtroom, after the defence questioned the first witness and ...

What long-term marijuana use may do to your memory
The more pot you smoke, the greater the impact, researchers find

Q&A: As prices fall, flash memory is eating the world
Sumit Sadana, SanDisk's chief strategy officer and general manager of its Enterprise Solutions unit, shared his insights on the pending merger ...

Q&A: As prices fall, flash memory is eating the world
... SanDisk for some $19 billion in a deal that once finalized will marry leaders in the traditional hard drive and the emerging flash memory markets. ...

CVS Sued Over Claims Its Algae Supplement Improves Memory
Drugstore giant CVS is being sued for marketing and advertising its algae-based Algal-900 DHA supplements as proven memory enhancers, when the ...

Toshiba to buy land to expand flash memory production
Toshiba is looking to expand production of its proprietary BiCS flash 3D memory by acquiring 150,000 square meters of land in Japan's Mie prefecture, ...

Celine Dion Keeps Memory of Rene Angelil Alive With Gold Cast of His Hand
The GRAMMY winner immortalized her late husband's hand for a touching reason.

Resources last updated: 2/5/2016 1:39:02 PM