{"id":5417,"date":"2023-09-06T11:36:45","date_gmt":"2023-09-06T06:06:45","guid":{"rendered":"https:\/\/sourcebae.com\/blog\/?p=5417"},"modified":"2025-10-06T15:01:32","modified_gmt":"2025-10-06T09:31:32","slug":"how-do-you-write-javascript-code-inside-php","status":"publish","type":"post","link":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/","title":{"rendered":"How do you write JavaScript code inside PHP?"},"content":{"rendered":"\n<p>JavaScript is a powerful scripting language that adds interactivity and dynamic behavior to websites. PHP, on the other hand, is a server-side scripting language commonly used for web development. While they serve different purposes, there are scenarios where you might need to integrate <strong>JavaScript in PHP<\/strong> scripts. In this guide, we will walk you through the process of writing JavaScript code inside PHP and explore various use cases and best practices.<\/p>\n\n\n\n<p>In the ever-evolving world of web development, knowing how to combine different technologies can be a game-changer. Integrating JavaScript into your PHP scripts allows you to create dynamic and responsive web applications. Whether you want to validate user inputs, manipulate the DOM (Document Object Model), or enhance the user experience, understanding how to write <a href=\"https:\/\/sourcebae.com\/blog\/best-practices-for-readable-and-maintainable-javascript-code\/\">JavaScript code<\/a> inside PHP is a valuable skill.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n\n\n<p>Let&#8217;s dive right in and explore the essential steps to start writing JavaScript code inside PHP. We&#8217;ll break it down into <a href=\"https:\/\/sourcebae.com\/blog\/comprehensive-guide-on-building-a-learning-management-system\/\">manageable chunks for a smoother learning<\/a> experience.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up Your Environment<\/h2>\n\n\n\n<p>Before you begin, ensure you have a development environment with PHP and a text editor installed. You can use popular text editors like <a href=\"https:\/\/sourcebae.com\/blog\/how-to-install-react-js-in-visual-studio-code\/\">Visual Studio Code<\/a> or Sublime Text. Having a web server like Apache or Nginx is also essential for testing your PHP scripts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Embedding JavaScript in PHP<\/h2>\n\n\n\n<p>To write JavaScript within a PHP file, you can use the <code>&lt;script><\/code> tag. This tag allows you to include JavaScript code directly in your PHP script. Here&#8217;s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/\/ Your PHP code here\n?>\n&lt;script>\n\/\/ Your JavaScript code here\n&lt;\/script><\/code><\/pre>\n\n\n\n<p><strong>\u2714 New best practice:<\/strong> Instead of directly interpolating PHP variables into <code>&lt;script><\/code>, always use <code>json_encode()<\/code> to avoid XSS and type conversion issues.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$username = \"John\";\n?>\n&lt;script>\n  const username = &lt;?php echo json_encode($username); ?>;\n&lt;\/script><\/code><\/pre>\n\n\n\n<p>This approach is safer and ensures your variables are correctly represented in JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript and PHP Interactions<\/h2>\n\n\n\n<p>Now that you know how to embed <strong>JavaScript in PHP<\/strong>, let&#8217;s explore various interactions between these two languages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Passing PHP Variables to JavaScript<\/h2>\n\n\n\n<p>One common use case is passing PHP variables to JavaScript. This enables you to dynamically <a href=\"https:\/\/sourcebae.com\/blog\/top-5-ai-code-generation-tools-in-2025\/\">generate JavaScript code<\/a> based on server-side data. To achieve this, you can use the <code>echo<\/code> statement to inject PHP variables into JavaScript:<\/p>\n\n\n\n<p>\u274c Old way (unsafe):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$username = \"John\";\necho \"&lt;script>let username = '$username';&lt;\/script>\";\n?><\/code><\/pre>\n\n\n\n<p>\u2714 Recommended way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$username = \"John\";\n?>\n&lt;script>\n  const username = &lt;?php echo json_encode($username); ?>;\n&lt;\/script><\/code><\/pre>\n\n\n\n<p>In this example, we&#8217;ve created a JavaScript variable <code>username<\/code> and assigned it a value from PHP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Calling PHP Functions from JavaScript<\/h2>\n\n\n\n<p>Conversely, you can <a href=\"https:\/\/sourcebae.com\/blog\/how-can-i-return-an-array-from-php-to-an-ajax-call\/\">call PHP functions from JavaScript using AJAX<\/a> (Asynchronous JavaScript and XML). AJAX allows you to make asynchronous requests to the server and retrieve data without refreshing the entire page. Here&#8217;s a simplified example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>async function fetchData() {\n  const res = await fetch('fetch_data.php', {\n    method: 'POST',\n    headers: {'Content-Type': 'application\/json'},\n    body: JSON.stringify({action: 'get_data'})\n  });\n  const data = await res.json();\n  console.log(data);\n}<\/code><\/pre>\n\n\n\n<p>And in <code>fetch_data.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nheader('Content-Type: application\/json');\necho json_encode(&#91;'message' => 'Hello from PHP']);<\/code><\/pre>\n\n\n\n<p>In this case, the <code>fetchData<\/code> JavaScript function sends a request to <code>fetch_data.php<\/code>, a PHP script that processes the request and sends back a response.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advanced Techniques<\/h2>\n\n\n\n<p>As you become more proficient in combining <strong>PHP JavaScript<\/strong>, you can explore advanced techniques.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Form Validation<\/h2>\n\n\n\n<p>Use <strong>JavaScript inside PHP applications<\/strong> for client-side form validation before submission. This reduces server load and improves UX.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dynamic Content Loading<\/h2>\n\n\n\n<p>Load more data without a full refresh using AJAX\/fetch with <strong>script in PHP<\/strong> endpoints.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Real-Time Updates<\/h2>\n\n\n\n<p>Combine <strong>JavaScript in PHP backends<\/strong> with WebSockets or Server-Sent Events to build real-time apps like chats or dashboards.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Security &amp; Performance Considerations \u2705 <strong>(New Section)<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Always escape variables:<\/strong> Use <code>json_encode()<\/code> for safe PHP\u2192JS injection.<\/li>\n\n\n\n<li><strong>Prevent XSS:<\/strong> Never echo raw user input inside <code>&lt;script><\/code>.<\/li>\n\n\n\n<li><strong>CSRF protection:<\/strong> When calling PHP endpoints with JavaScript, use CSRF tokens.<\/li>\n\n\n\n<li><strong>Content Security Policy:<\/strong> Prefer external scripts and use CSP headers.<\/li>\n\n\n\n<li><strong>Performance:<\/strong> Add <code>defer<\/code> to <code>&lt;script><\/code> tags, bundle\/minify JS, and avoid unnecessary server calls.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How do I include external JavaScript libraries in my PHP project?<\/strong><\/h3>\n\n\n\n<p>Use the <code>&lt;script><\/code> tag with a <code>src<\/code> attribute. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script defer src=\"https:\/\/example.com\/library.js\">&lt;\/script><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Can I write PHP code within a JavaScript file?<\/strong><\/h3>\n\n\n\n<p>No, PHP code cannot be directly written within a <a href=\"https:\/\/www.javatpoint.com\/javascript-example\">JavaScript<\/a> file (with a .js extension). PHP files typically have a .php extension and are executed on the server, while JavaScript files are executed on the client-side.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Is it necessary to escape PHP variables when passing them to JavaScript?<\/strong><\/h3>\n\n\n\n<p>Yes, it&#8217;s essential to properly escape PHP variables when injecting them into JavaScript to prevent security vulnerabilities like cross-site scripting (XSS) attacks. You can use functions like <code>json_encode<\/code> or <code>htmlspecialchars<\/code> for safe variable handling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Are there any performance considerations when using JavaScript and PHP together?<\/strong><\/h3>\n\n\n\n<p>Yes, combining JavaScript and PHP should be done thoughtfully to avoid excessive server requests and ensure optimal performance. Caching, asynchronous loading, and minimizing unnecessary interactions are key strategies to consider.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Can I use PHP to generate dynamic JavaScript code?<\/strong><\/h3>\n\n\n\n<p>Absolutely! PHP can generate dynamic JavaScript code by generating JavaScript strings based on server-side data or conditions. This flexibility allows you to create customized JavaScript logic as needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What tools can I use for debugging JavaScript and PHP interactions?<\/strong><\/h3>\n\n\n\n<p>For JavaScript, you can use browser developer tools like the Chrome DevTools or Firefox Developer Tools. For PHP, you can use debugging tools like Xdebug or built-in logging functions to troubleshoot your scripts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion <\/h2>\n\n\n\n<p>Learning how to <strong>use JavaScript in PHP<\/strong> opens up a world of possibilities in web development. This combination empowers you to create feature-rich, interactive, and user-friendly applications. By following best practices like safe variable handling, modern fetch requests, and strong security measures, you can master the art of combining <strong>PHP JavaScript<\/strong> effectively. So, go ahead and start building dynamic web experiences that leave a lasting impression on your users.<\/p>\n\n\n\n<p><a href=\"https:\/\/sourcebae.com\/hire\/javascript-developers\">Hire JavaScript Developer <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is a powerful scripting language that adds interactivity and dynamic behavior to websites. PHP, on the other hand, is a server-side scripting language commonly used for web development. While they serve different purposes, there are scenarios where you might need to integrate JavaScript in PHP scripts. In this guide, we will walk you through [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":9651,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,18,25],"tags":[468,955,956],"class_list":["post-5417","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all","category-java","category-javascript","tag-how-do-you-write-javascript-code-inside-php","tag-write-javascript-code","tag-write-javascript-code-inside-php"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How do you write JavaScript code inside PHP? - SourceBae<\/title>\n<meta name=\"description\" content=\"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do you write JavaScript code inside PHP? - SourceBae\" \/>\n<meta property=\"og:description\" content=\"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/\" \/>\n<meta property=\"og:site_name\" content=\"SourceBae\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-06T06:06:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-06T09:31:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1240\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Priyanshu Pathak\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Priyanshu Pathak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/\",\"url\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/\",\"name\":\"How do you write JavaScript code inside PHP? - SourceBae\",\"isPartOf\":{\"@id\":\"https:\/\/sourcebae.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg\",\"datePublished\":\"2023-09-06T06:06:45+00:00\",\"dateModified\":\"2025-10-06T09:31:32+00:00\",\"author\":{\"@id\":\"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/73a46422e4aa329800c79033bb786b14\"},\"description\":\"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.\",\"breadcrumb\":{\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage\",\"url\":\"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg\",\"contentUrl\":\"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg\",\"width\":1240,\"height\":620,\"caption\":\"How do you write JavaScript code inside PHP?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sourcebae.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do you write JavaScript code inside PHP?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sourcebae.com\/blog\/#website\",\"url\":\"https:\/\/sourcebae.com\/blog\/\",\"name\":\"SourceBae\",\"description\":\"Creative Blog Website\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sourcebae.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/73a46422e4aa329800c79033bb786b14\",\"name\":\"Priyanshu Pathak\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc14902525055d47f414b0d28a1c668638de01414b85a9a178bc54785a53d5de?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc14902525055d47f414b0d28a1c668638de01414b85a9a178bc54785a53d5de?s=96&d=mm&r=g\",\"caption\":\"Priyanshu Pathak\"},\"sameAs\":[\"https:\/\/sourcebae.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How do you write JavaScript code inside PHP? - SourceBae","description":"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/","og_locale":"en_US","og_type":"article","og_title":"How do you write JavaScript code inside PHP? - SourceBae","og_description":"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.","og_url":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/","og_site_name":"SourceBae","article_published_time":"2023-09-06T06:06:45+00:00","article_modified_time":"2025-10-06T09:31:32+00:00","og_image":[{"width":1240,"height":620,"url":"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg","type":"image\/jpeg"}],"author":"Priyanshu Pathak","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Priyanshu Pathak","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/","url":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/","name":"How do you write JavaScript code inside PHP? - SourceBae","isPartOf":{"@id":"https:\/\/sourcebae.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage"},"image":{"@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage"},"thumbnailUrl":"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg","datePublished":"2023-09-06T06:06:45+00:00","dateModified":"2025-10-06T09:31:32+00:00","author":{"@id":"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/73a46422e4aa329800c79033bb786b14"},"description":"Learn how to seamlessly integrate or write javascript in php. Follow step-by-step instructions for dynamic web development.","breadcrumb":{"@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#primaryimage","url":"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg","contentUrl":"https:\/\/sourcebae.com\/blog\/wp-content\/uploads\/2023\/09\/Add-a-heading-63.jpg","width":1240,"height":620,"caption":"How do you write JavaScript code inside PHP?"},{"@type":"BreadcrumbList","@id":"https:\/\/sourcebae.com\/blog\/how-do-you-write-javascript-code-inside-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sourcebae.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How do you write JavaScript code inside PHP?"}]},{"@type":"WebSite","@id":"https:\/\/sourcebae.com\/blog\/#website","url":"https:\/\/sourcebae.com\/blog\/","name":"SourceBae","description":"Creative Blog Website","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sourcebae.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/73a46422e4aa329800c79033bb786b14","name":"Priyanshu Pathak","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sourcebae.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc14902525055d47f414b0d28a1c668638de01414b85a9a178bc54785a53d5de?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc14902525055d47f414b0d28a1c668638de01414b85a9a178bc54785a53d5de?s=96&d=mm&r=g","caption":"Priyanshu Pathak"},"sameAs":["https:\/\/sourcebae.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/posts\/5417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/comments?post=5417"}],"version-history":[{"count":6,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/posts\/5417\/revisions"}],"predecessor-version":[{"id":13558,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/posts\/5417\/revisions\/13558"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/media\/9651"}],"wp:attachment":[{"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/media?parent=5417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/categories?post=5417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sourcebae.com\/blog\/wp-json\/wp\/v2\/tags?post=5417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}