

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do you make a string in PHP with a backslash in it?
When the backslash \ does not escape the terminating quote of the string or even create a valid escape sequence (in double quoted strings), then the below code can be used to produce one backslash −
Example
$string = 'abc\def'; print($string);
Output
This will produce the following output −
abc\def
Example
$string = "abc\def"; print($string);
Output
This will produce the following output −
abc\def
- Related Questions & Answers
- How do I un-escape a backslash-escaped string in Python?
- How do you make a list iterator in Java?
- MySQL query to replace backslash from a varchar column with preceding backslash string values
- How do you make a shallow copy of a list in Java?
- How important is backslash in breaking a string in JavaScript?
- How do you reverse a string in place in JavaScript?
- How do you make code reusable in C#?
- How would you make a comma-separated string from a list in Python?
- How do you convert a string to a character array in JavaScript?
- What will you do to make your man go crazy in love with you?
- How do you create a list with values in Java?
- How do you make a separation and divorce as amicable as possible?
- How do you reverse a string in place in C or C++?
- How do you validate a URL with a regular expression in Python?
- How do you make a button that adds text in HTML <input>?
Advertisements