Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:53:08+00:00 2026-06-11T08:53:08+00:00

I have a file that has a line of code like this: $var =

  • 0

I have a file that has a line of code like this:

$var = "<link rel=\"stylesheet\" href=\"" . GLOBAL_PATH . "system/modules/" . $path . "/" . $css . "\" media=\"screen\">"

I’m opening it into a then saving it back to the server. When I save back to the server using fwrite() and then reopen I get this:

$var = "<link rel="stylesheet" href="" . GLOBAL_PATH . "system/modules/" . $path . "/" . $css . "" media="screen">"

…where the slashes escaping the quotes are gone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:53:10+00:00Added an answer on June 11, 2026 at 8:53 am

    They’re not “gone”, as they were technically not in the original string. Consider this:

    $str = "\"";
    echo strlen($str); // 1, not 2!
    

    … as $str string stores only one symbol (a double quote mark), and backslash is used to prevent it from being misread as an ending of the string literal.

    While PHP is able to magically restore ‘lost’ slashes (with magic_quotes_runtime directive), it’s been deprecated in PHP 5.3 and removed in 5.4.

    The alternative is using addslashes() function when you indeed need them restored.

    $str = "\"";
    echo addslashes($str); // \"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the file that has content like this per line 3021e69d9d2569db27ce7b74ccaa98496007de09a1f4b94e45f48203d8727ac6 test.com [05/Jul/2011:07:28:57
I have a test file that has many lines, each line looks something like:
I have a log file that has lines that look like this: 1,2546857-23541,f_last,user,4:19 P.M.,11/02/2009,START,27,27,3,c2546857-23541,
I have a .py file that a php file runs like this: $link =
I have a text file that has item numbers in it (one per line).
In short, I have a 20,000,000 line csv file that has different row lengths.
I have a html file that has invoice details I would like to know
I have an xml file that has an address node that looks like <address>
I have a php application that has about 50-55 code files. The file that
With VS2008 SP1 I have a line of code like this in an aspx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.