NameSilo

Write HTML tags to file (PHP)

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by 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
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
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back