{"id":1468,"date":"2021-05-05T23:24:03","date_gmt":"2021-05-05T23:24:03","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=1468"},"modified":"2025-04-07T12:43:09","modified_gmt":"2025-04-07T12:43:09","slug":"php-str_replace","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/php-str_replace\/","title":{"rendered":"PHP str_replace"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the PHP <code>str_replace()<\/code> function to replace all occurrences of a substring with a new string<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-str_replace-function'>Introduction to the PHP str_replace() function <a href=\"#introduction-to-the-php-str_replace-function\" class=\"anchor\" id=\"introduction-to-the-php-str_replace-function\" title=\"Anchor for Introduction to the PHP str_replace() function\">#<\/a><\/h2>\n\n\n\n<p>The PHP <code>str_replace()<\/code> function returns a new <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-string\/\">string<\/a> with all occurrences of a substring replaced with another string.<\/p>\n\n\n\n<p>The following shows the syntax of the <code>str_replace()<\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">str_replace ( \n    <span class=\"hljs-keyword\">array<\/span>|string $search , \n    <span class=\"hljs-keyword\">array<\/span>|string $replace , \n    string|<span class=\"hljs-keyword\">array<\/span> $subject , \n    int &amp;$count = <span class=\"hljs-keyword\">null<\/span> \n) : string|<span class=\"hljs-keyword\">array<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>str_replace()<\/code> has the following parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>$search<\/code> is a substring to be replaced.<\/li>\n\n\n\n<li>The <code>$replace<\/code> is the replacement string that replaces the<code>$search<\/code> value.<\/li>\n\n\n\n<li>The <code>$subject<\/code> is the input string<\/li>\n\n\n\n<li>The <code>$count<\/code> returns the number of replacements that the function performed. The <code>$count<\/code> is optional.<\/li>\n<\/ul>\n\n\n\n<p>If the <code>$search<\/code> and <code>$replace<\/code> arguments are <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array\/\">arrays<\/a>, the <code>str_replace()<\/code> takes each value from the <code>$search<\/code> array (from left to right) and replaces it with each value from the <code>$replace<\/code> array.<\/p>\n\n\n\n<p>If the <code>$replace<\/code> array has fewer elements than the <code>$search<\/code> array, the <code>str_replace()<\/code> function uses an empty string for the replacement values.<\/p>\n\n\n\n<p>If the <code>$search<\/code> is an array and the <code>$replace<\/code> is a string, then the <code>str_replace()<\/code> function replaces every element in the <code>$search<\/code> with the <code>$replace<\/code> string.<\/p>\n\n\n\n<p class=\"note\">Note that the <code>str_replace()<\/code> doesn&#8217;t change the input string (<code>$subject<\/code>). It returns a new array with the <code>$search<\/code> replaced with the <code>$replace<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='php-str_replace-function-examples'>PHP str_replace() function examples <a href=\"#php-str_replace-function-examples\" class=\"anchor\" id=\"php-str_replace-function-examples\" title=\"Anchor for PHP str_replace() function examples\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using the PHP <code>str_replace()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='simple-php-str_replace-function-examples'>Simple PHP str_replace() function examples <a href=\"#simple-php-str_replace-function-examples\" class=\"anchor\" id=\"simple-php-str_replace-function-examples\" title=\"Anchor for Simple PHP str_replace() function examples\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>str_replace()<\/code> function to replace the string <code>'Hello'<\/code> with <code>'Hi'<\/code> in the string <code>'Hello there'<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$str = <span class=\"hljs-string\">'Hello there'<\/span>;\n$new_str = str_replace(<span class=\"hljs-string\">'Hello'<\/span>, <span class=\"hljs-string\">'Hi'<\/span>, $str);\n\n<span class=\"hljs-keyword\">echo<\/span> $new_str . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ Hi there<\/span>\n\n<span class=\"hljs-keyword\">echo<\/span> $str . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ Hello there<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRzdHIgPSAnSGVsbG8gdGhlcmUnOwokbmV3X3N0ciA9IHN0cl9yZXBsYWNlKCdIZWxsbycsICdIaScsICRzdHIpOwoKZWNobyAkbmV3X3N0ciAuICc8YnI-JzsgLy8gSGkgdGhlcmUKCmVjaG8gJHN0ciAuICc8YnI-JzsgLy8gSGVsbG8gdGhlcmU\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">Hi there\nHello there<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As shown in the output, the <code>str_replace()<\/code> doesn&#8217;t change the input string but returns a new string with the substring <code>'Hello'<\/code> replaced by the string <code>'Hi'<\/code>;<\/p>\n\n\n\n<p>The following example uses the <code>str_replace()<\/code> function to replace the substring <code>'bye'<\/code> with the string <code>'hey'<\/code> in the string <code>'bye bye bye'<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$str = <span class=\"hljs-string\">'bye bye bye'<\/span>;\n$new_str = str_replace(<span class=\"hljs-string\">'bye'<\/span>, <span class=\"hljs-string\">'hey'<\/span>, $str);\n\n<span class=\"hljs-keyword\">echo<\/span> $new_str; <span class=\"hljs-comment\">\/\/ hey hey hey<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRzdHIgPSAnYnllIGJ5ZSBieWUnOwokbmV3X3N0ciA9IHN0cl9yZXBsYWNlKCdieWUnLCAnaGV5JywgJHN0cik7CgplY2hvICRuZXdfc3RyOyAvLyBoZXkgaGV5IGhleQ\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">hey hey hey<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='using-php-str_replace-function-with-the-count-argument-example'>Using PHP str_replace() function with the count argument example <a href=\"#using-php-str_replace-function-with-the-count-argument-example\" class=\"anchor\" id=\"using-php-str_replace-function-with-the-count-argument-example\" title=\"Anchor for Using PHP str_replace() function with the count argument example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>str_replace()<\/code> function with the count argument:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span> \n\n$str = <span class=\"hljs-string\">'Hi, hi, hi'<\/span>;\n$new_str = str_replace(<span class=\"hljs-string\">'hi'<\/span>, <span class=\"hljs-string\">'bye'<\/span>, $str, $count);\n\n<span class=\"hljs-keyword\">echo<\/span> $count; <span class=\"hljs-comment\">\/\/ 2<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAgCgokc3RyID0gJ0hpLCBoaSwgaGknOwokbmV3X3N0ciA9IHN0cl9yZXBsYWNlKCdoaScsICdieWUnLCAkc3RyLCAkY291bnQpOwoKZWNobyAkY291bnQ7IC8vIDI\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, the <code>str_replace()<\/code> function replaces the substring <code>'hi'<\/code> with the string <code>'bye'<\/code> in the string <code>'Hi, hi, hi'<\/code>.<\/p>\n\n\n\n<p>The count returns two because the <code>str_replace()<\/code> function only replaces the substring <code>'hi'<\/code> not <code>'Hi'<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='php-str_replace-function-with-multiple-replacements-example'>PHP str_replace() function with multiple replacements example <a href=\"#php-str_replace-function-with-multiple-replacements-example\" class=\"anchor\" id=\"php-str_replace-function-with-multiple-replacements-example\" title=\"Anchor for PHP str_replace() function with multiple replacements example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>str_replace()<\/code> function to replace the <code>fox<\/code> with <code>wolf<\/code> and <code>dog<\/code> with <code>cat<\/code> in the string <code>'The quick brown fox jumps over the lazy dog'<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$str = <span class=\"hljs-string\">'The quick brown fox jumps over the lazy dog'<\/span>;\n$animals = &#91;<span class=\"hljs-string\">'fox'<\/span>, <span class=\"hljs-string\">'dog'<\/span>];\n$new_animals = &#91;<span class=\"hljs-string\">'wolf'<\/span>, <span class=\"hljs-string\">'cat'<\/span>];\n\n$new_str = str_replace($animals, $new_animals, $str);\n\n<span class=\"hljs-keyword\">echo<\/span> $new_str;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRzdHIgPSAnVGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZyc7CiRhbmltYWxzID0gWydmb3gnLCAnZG9nJ107CiRuZXdfYW5pbWFscyA9IFsnd29sZicsICdjYXQnXTsKCiRuZXdfc3RyID0gc3RyX3JlcGxhY2UoJGFuaW1hbHMsICRuZXdfYW5pbWFscywgJHN0cik7CgplY2hvICRuZXdfc3RyOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">The quick brown wolf jumps over the lazy cat<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Since the <code>str_replace()<\/code> function replaces left to right, it might replace previously replaced value while doing multiple replacements. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$str = <span class=\"hljs-string\">'apple'<\/span>;\n\n$fruits = &#91;<span class=\"hljs-string\">'apple'<\/span>, <span class=\"hljs-string\">'orange'<\/span>, <span class=\"hljs-string\">'banana'<\/span>];\n$replacements = &#91;<span class=\"hljs-string\">'orange'<\/span>, <span class=\"hljs-string\">'banana'<\/span>, <span class=\"hljs-string\">'strawberry'<\/span>];\n\n$new_str = str_replace($fruits, $replacements, $str, $count);\n\n<span class=\"hljs-keyword\">echo<\/span> $new_str; <span class=\"hljs-comment\">\/\/ strawberry<\/span>\n<span class=\"hljs-keyword\">echo<\/span> $count; <span class=\"hljs-comment\">\/\/ 3<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRzdHIgPSAnYXBwbGUnOwoKJGZydWl0cyA9IFsnYXBwbGUnLCAnb3JhbmdlJywgJ2JhbmFuYSddOwokcmVwbGFjZW1lbnRzID0gWydvcmFuZ2UnLCAnYmFuYW5hJywgJ3N0cmF3YmVycnknXTsKCiRuZXdfc3RyID0gc3RyX3JlcGxhY2UoJGZydWl0cywgJHJlcGxhY2VtZW50cywgJHN0ciwgJGNvdW50KTsKCmVjaG8gJG5ld19zdHI7IC8vIHN0cmF3YmVycnkKZWNobyAkY291bnQ7IC8vIDM\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, the string apple is replaced with orange, orange is replaced with banana, and banana is replaced with strawberry. The returned string is strawberry.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='php-str_ireplace-function'>PHP str_ireplace() function <a href=\"#php-str_ireplace-function\" class=\"anchor\" id=\"php-str_ireplace-function\" title=\"Anchor for PHP str_ireplace() function\">#<\/a><\/h2>\n\n\n\n<p>To search for a string case-insensitively and replace it with a replacement string, you use the <code>str_ireplace()<\/code> function. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$str = <span class=\"hljs-string\">'Hi, hi, hi'<\/span>;\n$new_str = str_ireplace(<span class=\"hljs-string\">'hi'<\/span>, <span class=\"hljs-string\">'bye'<\/span>, $str, $count);\n\n<span class=\"hljs-keyword\">echo<\/span> $new_str; <span class=\"hljs-comment\">\/\/ bye, bye, bye<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRzdHIgPSAnSGksIGhpLCBoaSc7CiRuZXdfc3RyID0gc3RyX2lyZXBsYWNlKCdoaScsICdieWUnLCAkc3RyLCAkY291bnQpOwoKZWNobyAkbmV3X3N0cjsgLy8gYnllLCBieWUsIGJ5ZQ\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, the <code>str_ireplace()<\/code> function replaces the substring <code>'hi'<\/code> or <code>'Hi'<\/code> with the string <code>'bye'<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>str_replace()<\/code> function to replace a substring with another string.<\/li>\n\n\n\n<li>Use the <code>str_ireplace()<\/code> function to search a substring case-insensitively and replace it with another string.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1468\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-str_replace\/\"\n\t\t\t\tdata-post-title=\"PHP str_replace\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1468\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-str_replace\/\"\n\t\t\t\tdata-post-title=\"PHP str_replace\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use PHP str_replace() function to return a new string with all occurrences of a substring replaced with another string.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":110,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1468","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":4,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1468\/revisions"}],"predecessor-version":[{"id":3249,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1468\/revisions\/3249"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/15"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}