Solved

PHP

Posted on 2011-03-19
2
608 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 look for a specific file type in a local or remote server directory using PHP.
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 …

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now