Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Write HTML tags to file (PHP)

SpaceshipSpaceship
SpaceshipSpaceship
NamecheapNamecheap
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Change
PHP:
  $thetext= "<html><head><meta name="description" content="test file">";

to

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

Rep+ to both :)
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back