You're missing a ; on line 1.

$display_box_content = '<div style="box-sizing: border-box; color: rgb(37, 37, 37); font-family: Axiforma-Regular; font-size: 16px;"></div>'; //added a ; here
$display_box_content = str_replace('"', "'", $display_box_content);   

This code actually works; Please see 3v4l

Answer from IsThisJavascript on Stack Overflow
Discussions

How to replace one single quote by two single quotes in a string with PHP? - Stack Overflow
I want to replace this using str_replace of PHP 'test by test EDIT Done by this : $test = str_replace("'", "''", "'test"); More on stackoverflow.com
🌐 stackoverflow.com
December 28, 2013
php string replace quotes - Stack Overflow
Hello I am trying to get all single quotes to be double quotes using the php str_replace however it does not seem to be working no matter what I do, suggestions ... You're thinking regex. You don't need / / for string replace. ... Save this answer. ... Show activity on this post. Update: I'd agree with ... More on stackoverflow.com
🌐 stackoverflow.com
Replacing double quotes with single quotes - Post.Byes - Bytes
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into a javascript function called by onClick. The problem is that the text may contain single or double ... More on post.bytes.com
🌐 post.bytes.com
July 17, 2005
php - str_replace double and single quotes - Stack Overflow
This still produces the same result. double quotes are escaped, single quotes are ignored. 2013-08-22T17:36:04.547Z+00:00 ... Can you show me your input string? And do you have other str_replaces? More on stackoverflow.com
🌐 stackoverflow.com
August 23, 2013
🌐
Bytes
bytes.com › home › forum › topic › php
Replacing double quotes with single quotes - Post.Byes
November 1, 2015 - Example: <? $text = "This is a string with 'single quotes' and " . '"double quotes" in it.'; echo $text."\n"; echo str_replace('"' ,"'",$text)."\n "; echo htmlentities($t ext,ENT_QUOTES) ; ?> Yields: php -q quotetest.php This is a string with 'single quotes' and "double quotes" in it.
🌐
PHP
php.net › manual › en › function.addslashes.php
PHP: addslashes - Manual
If all you want to do is quote ... a URL with args), don't use addslashes (you don't want both " and ' escaped at the same time). Instead, just use this function: <?php function Quote($Str) // Double-quoting only { $Str=str_replace('"','\"',$Str); return '"'.$Str.'"'; } // Quote ?> Modify this easily to get a single-quoting ...
🌐
Narkive
comp.lang.php.narkive.com › wJtbiNE9 › replacing-double-quotes-with-single-quotes
Replacing double quotes with single quotes
Example: <? $text = "This is a string with 'single quotes' and " . '"double quotes" in it.'; echo $text."\n"; echo str_replace('"',"'",$text)."\n"; echo htmlentities($text,ENT_QUOTES); ?> Yields: php -q quotetest.php This is a string with 'single quotes' and "double quotes" in it.
Find elsewhere
🌐
PHPBuilder
board.phpbuilder.com › d › 10395363-replacing-a-single-quotation-mark-in-a-string
replacing a single quotation mark in a string - PHPBuilder Forums
January 5, 2017 - I have $mystring = "Bill's components"; I want to get rid of the ' and replace it with a space (hopefully giving $mystring="Bill s components") so I wrote...
🌐
Reddit
reddit.com › r/wordpress › replacing or removing double quotes with preg_replace
r/Wordpress on Reddit: replacing OR removing double quotes with preg_replace
October 3, 2019 -

Hi,
the purpose of this is to be used in an article schema markup in the "articleBody" field,
what i have used until now is <?php $examplePost = get_post();

echo preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', wp_strip_all_tags($examplePost->post_content)); ?>

which works PERFECT! that until the article includes double quotes, and when it does, the schema markup picks up on it and throws an error "

JSON-LD

Missing ',' or '}' in object declaration."

which disable the whole schema.
i would prefer to be able to keep (by skip/ignore the double quotes ) or replace the double quotes wish single quote but if not possible, removing them is also alright.

i tried changing to str_replace and other methods i found online but couldnt get it to work.

Help?

🌐
GitHub
github.com › phalcon › cphalcon › issues › 16019
Volt Replacing Single Quote with Double Quote · Issue #16019 · phalcon/cphalcon
August 11, 2022 - The code is replacing the single quotes with double quotes which is breaking everything.
Author: phalcon
🌐
Laracasts
laracasts.com › discuss › channels › php › how-to-resolve-a-php-regex-search-and-replace-which-breaks-when-adding-single-quote-inside-single-quoted-strings
How to resolve a PHP regex search and replace which breaks when adding single quote inside single quoted strings?
The final result of this code is ... that breaks when adding single quotes inside single quoted strings, you can either use double quotes instead of single quotes for your regex pattern, or you can escape the single quote character inside your single quoted strin...