{"id":16530,"date":"2013-02-26T21:01:11","date_gmt":"2013-02-26T13:01:11","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=16530"},"modified":"2025-04-04T01:29:42","modified_gmt":"2025-04-03T17:29:42","slug":"webdev-with-mongodb-part3","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/","title":{"rendered":"MongoDB For Beginners &#8211; Setting Up MongoDB For PHP (Part III)"},"content":{"rendered":"<p>Before diving into this, I recommend that you read the following related articles if you have not:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part1\/\">Introduction to MongoDB<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part2\/\">Basic MongoDB shell commands<\/a><\/li>\n<\/ul>\n<p>The MongoDB server is built to already work with your current web server. The problem is that you\u2019ll need to install drivers for your preferred backend language \u2013 PHP, Ruby, Node.js, Perl, whatever. I won\u2019t go into the process of installing WAMP\/MAMP because this is a bit off topic from Mongo.<\/p>\n<p>But there are very easy-to-follow tutorials which already exist for <a href=\"https:\/\/www.tutorialchip.com\/php\/wamp-server-installation-guide-for-windows-7-3264-bits\/\">installing WAMP<\/a> and <a href=\"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/\">installing MAMP<\/a> on either Operating System<strong>.<\/strong><\/p>\n<p><strong>Note:<\/strong> You can still work with your MongoDB server without a web server. But most applications would require this and that\u2019s why I\u2019m focusing primarily on MongoDB for web development.<\/p>\n<p>You can get some output from the MongoDB process by visiting the localhost address using your installation\u2019s specific port number.<\/p>\n<p>MongoDB will default to <em>27017<\/em>. This is the driver port and to view analytics\/diagnostics, we want to use <em>28017<\/em>. So you may access the MongoDB server info on your browser by visiting:<\/p>\n<p><code>http:\/\/localhost:28017<\/code><\/p>\n<p>This address should still work properly regardless of whether your local web server is online or not.<\/p>\n<p>After you have WAMP or MAMP installed and running, you can visit the localhost web server on port :80 to see the default page template.<\/p>\n<p>Now I\u2019m going to walk you through installing the PHP driver, and we\u2019ll finish up developing over MongoDB\u2019s PHP class library.<\/p>\n<h2>Setup the MongoDB PHP Drivers<\/h2>\n<p>Mac and Linux users should be able to install these drivers right from the command line. Looking on the MongoDB <a href=\"https:\/\/docs.mongodb.com\/ecosystem\/drivers\/php\/\">PHP language docs<\/a> we should install using pecl from the <a href=\"https:\/\/pear.php.net\/\">Pear Library<\/a> of PHP code.<\/p>\n<p>Here\u2019s the line of code you should run from the terminal:<\/p>\n<pre>sudo apt-get install php5-dev php5-cli php-pear\r\nsudo pecl install mongo<\/pre>\n<p>If you already have Pear installed then you don\u2019t need to run the first line. That is only for PHP installs that are not updated to the latest Pear library. But after the commands finish locate your <strong>php.ini<\/strong> file and add the following bit of code:<\/p>\n<pre>extension=mongo.so\r\n<\/pre>\n<p>You should notice a similar block of code somewhere midway down the file, which has a slew of other lines mirroring extension=name. Most extensions are commented out, but the lines without a hash symbol(#) are currently active extensions.<\/p>\n<p>After you\u2019ve added this line save & close the file, then restart your Apache web server for the new changes to take effect.<\/p>\n<h2>Mongo PHP Extension on Windows<\/h2>\n<p>All users on Windows will also need to edit their php.ini file. This can be accomplished directly from the WAMP context menu by clicking on the icon, then moving to PHP -&gt; php.ini. You\u2019ll need to add the same line of code, except the filename should be <strong>php_mongo.dll<\/strong>.<\/p>\n<p>Also instead of installing through the command line, it\u2019s much easier to download a copy of the extension and move this over manually.<\/p>\n<p>Windows users should head over to <a href=\"https:\/\/github.com\/mongodb\/mongo-php-driver\/downloads\" rel=\"nofollow\">this Github directory<\/a> full of MongoDB PHP drivers. Find the latest release which supports your version of PHP (5.2, 5.3, 5.4) and download the .zip. Once you extract the folder, find the extension which matches your version of PHP. In my case I\u2019ll use <strong>php_mongo-1.2.12-5.3-vc9.dll<\/strong> and rename this to <strong>php_mongo.dll<\/strong>.<\/p>\n<p>Now place this file directly inside your PHP extensions directory located in <code>C:\\wamp\\bin\\php\\php5.x\\ext\\<\/code>. If you have this file moved over and the extension line of code added to your php.ini file, then everything should be good to go! Restart your web server and open up a <code>phpinfo()<\/code> page to view the results.<\/p>\n<p>You can do a <span class=\"key\">CTRL<\/span> + <span class=\"key\">F<\/span> search for \u201cmongo\u201d and should find details about the module itself.<\/p>\n<h2>Mongo Web Development with PHP<\/h2>\n<p>There is so much to discuss when it comes to web development and databases. This is only an introduction tutorial so we won\u2019t be able to touch on many topics, including users, authentication, updating objects, multiple databases, etc. But let\u2019s finish up by going over the <a href=\"https:\/\/www.php.net\/manual\/en\/class.mongodb.php\" rel=\"nofollow\">PHP MongoDB class<\/a> and how we can quickly connect into a database.<\/p>\n<p>I\u2019ll use our test DB in this example accessing our previously created \u201cshows\u201d collection. We can pull all this data out using PHP and display the contents on a webpage. I\u2019m creating a new PHP file in my local server root named <strong>shows.php<\/strong> with the following code:<\/p>\n<pre>&lt;?php\r\n\/\/ Config\r\n$dbhost = 'localhost';\r\n$dbname = 'test';\r\n\r\n\/\/ Connect to test database\r\n$m = new Mongo(\"mongodb:\/\/$dbhost\");\r\n$db = $m-&gt;$dbname;\r\n\r\n\/\/ select the collection\r\n$collection = $db-&gt;shows;\r\n\r\n\/\/ pull a cursor query\r\n$cursor = $collection-&gt;find();\r\n\r\n?&gt;\r\n<\/pre>\n<p>What I\u2019m doing is selecting our test database and further accessing the internal shows collection. We can run the <a href=\"https:\/\/www.php.net\/manual\/en\/mongocollection.find.php\" rel=\"nofollow\">find()<\/a> function on any Mongo collection object to pull out a cursor with all the related internal data.<\/p>\n<p>Now to output this information onto the page let\u2019s use <a href=\"https:\/\/www.php.net\/manual\/en\/function.var-dump.php\">var_dump()<\/a> which is a much better alternative than <a href=\"https:\/\/www.php.net\/manual\/en\/function.print-r.php\">print_r()<\/a>. Add this last block of code directly underneath the <code>$cursor<\/code> variable.<\/p>\n<pre>foreach($cursor as $document) {\r\n var_dump($document);\r\n}<\/pre>\n<p>This <code>foreach()<\/code> loop will go through the cursor results and output variable data for each internal array. We should have 3 objects displaying the data added into our TV Shows earlier. You will notice there is also another key named <strong>_id<\/strong> which is the automatic object ID created for each document.<\/p>\n<p>I have to recommend just going through Google or the <a href=\"https:\/\/docs.mongodb.com\/\">MongoDB docs<\/a> to learn more about the PHP class. There is so much information that it cannot all be crammed into this introductory tutorial. But this small PHP script should be an example of just how flexible Mongo databases really are! No confusing SQL commands, no requirements for authentication(unless needed), and all the syntax is very easy to read.<\/p>\n<h2>Final Thoughts<\/h2>\n<p>Developers who are familiar with databases may still be pushing through this article with difficulty. Going through this tutorial two or three times may still even leave you confused on some terminology. But don\u2019t get discouraged by Mongo\u2019s initial hurdles. Even a week\u2019s worth of practice is enough to nail down a really good understanding.<\/p>\n<p>The Mongo open source database system is schemaless and quickly scalable in comparison to other rival systems. You are not limited to columns or tables and inserting data can be quickly accomplished through JSON-like syntax. Also, connecting your web applications using PHP is often easier than MySQL\/MSSQL once you understand the code.<\/p>\n<p>I do hope this beginner\u2019s tutorial can provide a solid overview from MongoDB terminology to <a href=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part1\/\">installation<\/a>, <a href=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part2\/\">shell commands<\/a>, and light web development.<\/p>\n<p>Overall Mongo may not be your first database choice when building a new web project. But the system is safe, very reliable, and slowly gaining attention with a growing community of dedicated supporters.<\/p>","protected":false},"excerpt":{"rendered":"<p>Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands The MongoDB server is built to already work with your current web server. The problem is that you\u2019ll need to install drivers for your preferred backend language \u2013 PHP, Ruby, Node.js,&hellip;<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[2315],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>MongoDB For Beginners: Setting up MongoDB For PHP<\/title>\n<meta name=\"description\" content=\"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB For Beginners - Setting Up MongoDB For PHP (Part III)\" \/>\n<meta property=\"og:description\" content=\"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-26T13:01:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:29:42+00:00\" \/>\n<meta name=\"author\" content=\"Jake Rocheleau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jake Rocheleau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/\"},\"author\":{\"name\":\"Jake Rocheleau\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\"},\"headline\":\"MongoDB For Beginners &#8211; Setting Up MongoDB For PHP (Part III)\",\"datePublished\":\"2013-02-26T13:01:11+00:00\",\"dateModified\":\"2025-04-03T17:29:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/\"},\"wordCount\":1105,\"commentCount\":15,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"MongoDB\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/\",\"name\":\"MongoDB For Beginners: Setting up MongoDB For PHP\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2013-02-26T13:01:11+00:00\",\"dateModified\":\"2025-04-03T17:29:42+00:00\",\"description\":\"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/webdev-with-mongodb-part3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MongoDB For Beginners &#8211; Setting Up MongoDB For PHP (Part III)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\",\"name\":\"Jake Rocheleau\",\"description\":\"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/jake\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MongoDB For Beginners: Setting up MongoDB For PHP","description":"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands","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:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/","og_locale":"en_US","og_type":"article","og_title":"MongoDB For Beginners - Setting Up MongoDB For PHP (Part III)","og_description":"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands","og_url":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2013-02-26T13:01:11+00:00","article_modified_time":"2025-04-03T17:29:42+00:00","author":"Jake Rocheleau","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Jake Rocheleau","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/"},"author":{"name":"Jake Rocheleau","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a"},"headline":"MongoDB For Beginners &#8211; Setting Up MongoDB For PHP (Part III)","datePublished":"2013-02-26T13:01:11+00:00","dateModified":"2025-04-03T17:29:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/"},"wordCount":1105,"commentCount":15,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["MongoDB"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/","url":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/","name":"MongoDB For Beginners: Setting up MongoDB For PHP","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2013-02-26T13:01:11+00:00","dateModified":"2025-04-03T17:29:42+00:00","description":"Before diving into this, I recommend that you read the following related articles if you have not: Introduction to MongoDB Basic MongoDB shell commands","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/webdev-with-mongodb-part3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"MongoDB For Beginners &#8211; Setting Up MongoDB For PHP (Part III)"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a","name":"Jake Rocheleau","description":"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers","sameAs":["https:\/\/www.hongkiat.com"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/jake\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4iC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=16530"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16530\/revisions"}],"predecessor-version":[{"id":73575,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16530\/revisions\/73575"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=16530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=16530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=16530"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=16530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}