Solved

PHP

Posted on 2011-03-19
2
611 Views
Last Modified: 2012-05-11
hi experts,

Supposing i have:

$test="blablabla";

what is the corect syntax for writing in the file param=blablabla   ?

$file=file_put_context("test.txt", "param=$test");

or

$file=file_put_context("test.txt", "param='$test'");

Thank you in advance.

Regards,
Raul

0
Comment
Question by:raulmonda
2 Comments
 
LVL 15

Accepted Solution

by:
ncoo earned 500 total points
ID: 35171402
Single quotes are best, it's less processing. But on such a small example there is very little in it.
$file=file_put_context('test.txt', 'param='.$test);

Open in new window

0
 

Author Closing Comment

by:raulmonda
ID: 35171406
Thank you.
Much appreciated.

Regards,
Raul
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question