Unstoppable Domains

Write HTML tags to file (PHP)

Spaceship Spaceship
Watch

w1ww

Established Member
Impact
9
Hello,

I'm trying to write some html tags to a file on php like:

PHP:
$thetext="<html><head><meta name="description" content="test file">";
fwrite($tempvar, $thetext);
But I get a string error: Parse error: syntax error, unexpected T_STRING

It works without the meta part, I think its because of the multiple " " , how can I make this work?

Thank you
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Change
PHP:
  $thetext= "<html><head><meta name="description" content="test file">";

to

PHP:
$thetext = '<html><head><meta name="description" content="test file">';
 
1
•••
Alternatively you can use
PHP:
 $thetext="<html><head><meta name=\"description\" content=\"test file\">";
 
1
•••
They both work, thank you!

Rep+ to both :)
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back