{"id":481,"date":"2019-03-14T11:00:13","date_gmt":"2019-03-14T10:00:13","guid":{"rendered":"https:\/\/bastienmalahieude.fr\/?p=481"},"modified":"2019-03-02T11:48:41","modified_gmt":"2019-03-02T10:48:41","slug":"importer-un-fichier-csv-en-tableau-php","status":"publish","type":"post","link":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/","title":{"rendered":"Import a CSV file into a PHP array"},"content":{"rendered":"<p>In a first article we saw how to\u00a0<a href=\"https:\/\/bastienmalahieude.fr\/exporter-tableau-php-csv-excel\/\">transform a PHP array and export it to a CSV file<\/a>\u00a0.\u00a0This article is the opposite, it will allow you to generate a PHP array from a CSV file.<\/p>\n<p>We will transform a CSV file containing this kind of data:<\/p>\n    <table class=\"table table-striped table-responsive\">\n        <thead>\n        <tr>\n                            <th>first name<\/th>\n                            <th>last name<\/th>\n                            <th>phone<\/th>\n                            <th>email<\/th>\n                    <\/tr>\n        <\/thead>\n        <tbody>\n                    <tr>\n                                    <td>Bastien<\/td>\n                                    <td>Malahieude<\/td>\n                                    <td>06 XX XX XX XX XX<\/td>\n                                    <td>contact@bastienmalahieude.fr<\/td>\n                            <\/tr>\n                    <tr>\n                                    <td>John<\/td>\n                                    <td>Doe<\/td>\n                                    <td>06 XX XX XX XX XX<\/td>\n                                    <td>john@doe.fr<\/td>\n                            <\/tr>\n                <\/tbody>\n    <\/table>\n\n\n    \n<p>&nbsp;<\/p>\n<p>and return a PHP array like this one:<\/p>\n<pre class=\"dump\">array(2) {\n  [0]=>\n  array(4) {\n    [\"first name\"]=>\n    string(7) \"Bastien\"\n    [\"last name\"]=>\n    string(10) \"Malahieude\"\n    [\"phone\"]=>\n    string(17) \"06 XX XX XX XX XX\"\n    [\"email\"]=>\n    string(28) \"contact@bastienmalahieude.fr\"\n  }\n  [1]=>\n  array(4) {\n    [\"first name\"]=>\n    string(4) \"John\"\n    [\"last name\"]=>\n    string(3) \"Doe\"\n    [\"phone\"]=>\n    string(17) \"06 XX XX XX XX XX\"\n    [\"email\"]=>\n    string(11) \"john@doe.fr\"\n  }\n}\n<\/pre>\n<p>&nbsp;<\/p>\n<p>For that we will create an\u00a0<em>import_csv_to_array<\/em>\u00a0function\u00a0which reads the data from a file and returns a PHP array. This function takes two parameters, but only one is mandatory:<\/p>\n<ul>\n<li><strong>$ file<\/strong>\u00a0: This parameter is the path to the file.<\/li>\n<li><strong>$ enclosure:<\/strong>\u00a0The character that surrounds strings.<\/li>\n<\/ul>\n<pre>function import_csv_to_array($file,$enclosure = '\"')\r\n{\r\n\/\/ @TODO Do something here\r\n}<\/pre>\n<p>At first, we will retrieve the contents of the file via the function\u00a0\u00a0<em><a href=\"http:\/\/php.net\/manual\/en\/function.file-get-contents.php\">file_get_contents<\/a>\u00a0.\u00a0<\/em><\/p>\n<pre>$csv_string = file_get_contents($file);<\/pre>\n<p>This content is stored as a string in the\u00a0<em>$csv_string<\/em>\u00a0variable<\/p>\n<h2>Guess the CSV file delimiter<\/h2>\n<p>Most CSV import programs ask the user to choose which delimiter is on their file.\u00a0Indeed, the data in a CSV file can be delimited by several strings.\u00a0The most common are the semicolon (;) the comma (,) or the tab.\u00a0It also happens in rare cases that the data is delimited by a pipe (|).<\/p>\n<p>Depending on the size of the CSV file, it is likely that the delimiter used is the character of these four that is most present in the file.\u00a0We will use this assumption to try to guess the separator used in the CSV file, and thus make the function compatible with as many files as possible.<\/p>\n<p>For that, we will first create a table with the possible delimiters.\u00a0Depending on your project you can add or remove some delimiters from the table:<\/p>\n<pre>\/\/ List of delimiters that we will check for\r\n$delimiters = array(';' => 0,',' => 0,\"\\t\" => 0,\"|\" => 0);<\/pre>\n<p><strong>Note: If you already know which delimiter is used in your files, this step is useless.<\/strong><\/p>\n<p>Then, using the\u00a0<em>substr_count<\/em> function, we will count the number of occurences of each of these delimiters, within the file content.<\/p>\n<pre>foreach ($delimiters as $delimiter => &$count) {\r\n    $count = substr_count($csv_string,$delimiter);\r\n}<\/pre>\n<p><em>Using\u00a0<strong>&amp;<\/strong>$count here allows you to add the result directly to the <strong>$delimiters<\/strong> array. You can also use \u00a0<strong>$delimiters[$delimiter]<\/strong>. <a href=\"http:\/\/php.net\/manual\/en\/control-structures.foreach.php\">More information here<\/a><\/em><\/p>\n<p>This loop then returns an array containing the number of occurrences of each of the supposed delimiters within the file content.<\/p>\n<p>The last step is to retrieve in the array the key for which the value\u00a0\u00a0<em>$count<\/em>\u00a0is the largest.\u00a0Here we will use the\u00a0<em>array_search<\/em>\u00a0function\u00a0\u00a0and the\u00a0<em>max<\/em>\u00a0function<\/p>\n<pre>array_search(max($delimiters), $delimiters);<\/pre>\n<h2>Exporting the data from the CSV file<\/h2>\n<p>The second step of our function is to recover all the data from the file in order to add them to our PHP array.<\/p>\n<p>For that, we will retrieve in a PHP array all the lines of the CSV file. In a CSV file, the line separator is always a new line\u00a0 &#8220;<em>\\n&#8221;.\u00a0 <\/em>For this, \u00a0we will use the function\u00a0<em>explode.<\/em><\/p>\n<pre>$lines = explode(\"\\n\", $csv_string);<\/pre>\n<p>Our CSV file contains headers, these headers are fetched in the first line.\u00a0The array_shift function retrieves the first row of an array.<\/p>\n<p>Then we use the\u00a0<a href=\"http:\/\/php.net\/manual\/fr\/function.str-getcsv.php\"><em>str_getcsv<\/em><\/a> function.\u00a0The latter is used to split a CSV line into a PHP array.<\/p>\n<pre>$head = str_getcsv(array_shift($lines),$delimiter,$enclosure);<\/pre>\n<p>Once the headers are recovered, we will create an array to store our output data. Then we can loop on all the other rows of the array with the procedure\u00a0<em>foreach<\/em><\/p>\n<pre>$array = array();\r\nforeach ($lines as $line) {\r\n\/\/ Gestion ici des lignes\r\n}<\/pre>\n<p>Sometimes some files have the last empty line.\u00a0For that, we check that the data exist in our line:<\/p>\n<pre>if(empty($line)) {\r\n    continue;\r\n}<\/pre>\n<p>If there is data, then we will export the contents of the line, in the same way as for the headers above:<\/p>\n<pre>$csv = str_getcsv($line,$delimiter,$enclosure);<\/pre>\n<p>Finally, using\u00a0\u00a0<em>array_combine<\/em>\u00a0we will be able to add the keys to the values \u200b\u200bof each line that we have recovered.\u00a0Then we can add it all in our main array $<em>array <\/em> the result of this function:<\/p>\n<pre>$array[] = array_combine( $head, $csv );<\/pre>\n<p>Finally, we return everything:<\/p>\n<pre>return $array;\r\n\r\n<\/pre>\n<h2>FONCTION PHP COMPL\u00c8TE<\/h2>\n<p>In order to make the code more understandable, I decided to cut the part that guesses the separator of the CSV file in a second dedicated\u00a0<em>detect_delimiter<\/em> function:<\/p>\n<p>The final function we have just created is the following:<\/p>\n<pre>\/**\r\n *\r\n * This function allows you to import a CSV file and export it into a PHP array\r\n *\r\n * @param string $file      The file you want to import the data from\r\n * @param string $enclosure The type of enclosure used in the CSV file\r\n *\r\n * @return array            The array containing the CSV infos\r\n *\/\r\nfunction import_csv_to_array($file,$enclosure = '\"')\r\n{\r\n\r\n    \/\/ Let's get the content of the file and store it in the string\r\n    $csv_string = file_get_contents($file);\r\n\r\n    \/\/ Let's detect what is the delimiter of the CSV file\r\n    $delimiter = detect_delimiter($csv_string);\r\n\r\n    \/\/ Get all the lines of the CSV string\r\n    $lines = explode(\"\\n\", $csv_string);\r\n\r\n    \/\/ The first line of the CSV file is the headers that we will use as the keys\r\n    $head = str_getcsv(array_shift($lines),$delimiter,$enclosure);\r\n\r\n    $array = array();\r\n\r\n    \/\/ For all the lines within the CSV\r\n    foreach ($lines as $line) {\r\n\r\n        \/\/ Sometimes CSV files have an empty line at the end, we try not to add it in the array\r\n        if(empty($line)) {\r\n            continue;\r\n        }\r\n\r\n        \/\/ Get the CSV data of the line\r\n        $csv = str_getcsv($line,$delimiter,$enclosure);\r\n\r\n        \/\/ Combine the header and the lines data\r\n        $array[] = array_combine( $head, $csv );\r\n\r\n    }\r\n\r\n    \/\/ Returning the array\r\n    return $array;\r\n}\r\n\r\n\/**\r\n *\r\n * This function detects the delimiter inside the CSV file.\r\n *\r\n * It allows the function to work with different types of delimiters, \";\", \",\" \"\\t\", or \"|\"\r\n *\r\n *\r\n *\r\n * @param string $csv_string    The content of the CSV file\r\n * @return string               The delimiter used in the CSV file\r\n *\/\r\nfunction detect_delimiter($csv_string)\r\n{\r\n\r\n    \/\/ List of delimiters that we will check for\r\n    $delimiters = array(';' => 0,',' => 0,\"\\t\" => 0,\"|\" => 0);\r\n\r\n    \/\/ For every delimiter, we count the number of time it can be found within the csv string\r\n    foreach ($delimiters as $delimiter => &$count) {\r\n        $count = substr_count($csv_string,$delimiter);\r\n    }\r\n\r\n    \/\/ The delimiter used is probably the one that has the more occurrence in the file\r\n    return array_search(max($delimiters), $delimiters);\r\n\r\n}<\/pre>\n<p>The code is available Open source on the Github repo <a href=\"https:\/\/github.com\/Xusifob\/lib\">xusifob\/lib<\/a><\/p>\n<p>Feel free to leave your comments below<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a first article we saw how to\u00a0transform a PHP array and export it to a CSV file\u00a0.\u00a0This article is the opposite, it will allow you to generate a PHP array from a CSV file. We will transform a CSV file containing this kind of data: &nbsp; and return a PHP array like this one: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[23,22],"tags":[25,26,24],"class_list":["post-481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-wordpress","tag-csv","tag-excel","tag-importer"],"translation":{"provider":"WPGlobus","version":"3.0.0","language":"en","enabled_languages":["fr","en","es"],"languages":{"fr":{"title":true,"content":true,"excerpt":false},"en":{"title":true,"content":true,"excerpt":false},"es":{"title":false,"content":false,"excerpt":false}}},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Import a CSV file into a PHP array - Bastien Malahieude<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Import a CSV file into a PHP array - Bastien Malahieude\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Bastien Malahieude\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-14T10:00:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-02T10:48:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2019\/02\/DEVELOPER.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"bastien\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"bastien\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\"},\"author\":{\"name\":\"bastien\",\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7\"},\"headline\":\"Import a CSV file into a PHP array\",\"datePublished\":\"2019-03-14T10:00:13+00:00\",\"dateModified\":\"2019-03-02T10:48:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\"},\"wordCount\":1497,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7\"},\"keywords\":[\"CSV\",\"Excel\",\"Importer\"],\"articleSection\":[\"PHP\",\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\",\"url\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\",\"name\":\"Import a CSV file into a PHP array - Bastien Malahieude\",\"isPartOf\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/#website\"},\"datePublished\":\"2019-03-14T10:00:13+00:00\",\"dateModified\":\"2019-03-02T10:48:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/bastienmalahieude.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https:\/\/bastienmalahieude.fr\/category\/php\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Import a CSV file into a PHP array\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bastienmalahieude.fr\/#website\",\"url\":\"https:\/\/bastienmalahieude.fr\/\",\"name\":\"Bastien Malahieude\",\"description\":\"Growth Hacker - Web Developer - Project Manager\",\"publisher\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bastienmalahieude.fr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7\",\"name\":\"bastien\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2017\/10\/bastien-3-carre-2.png\",\"contentUrl\":\"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2017\/10\/bastien-3-carre-2.png\",\"width\":\"404\",\"height\":\"404\",\"caption\":\"bastien\"},\"logo\":{\"@id\":\"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Import a CSV file into a PHP array - Bastien Malahieude","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:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/","og_locale":"en_US","og_type":"article","og_title":"Import a CSV file into a PHP array - Bastien Malahieude","og_url":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/","og_site_name":"Bastien Malahieude","article_published_time":"2019-03-14T10:00:13+00:00","article_modified_time":"2019-03-02T10:48:41+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2019\/02\/DEVELOPER.jpg","type":"image\/jpeg"}],"author":"bastien","twitter_card":"summary_large_image","twitter_misc":{"Written by":"bastien","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#article","isPartOf":{"@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/"},"author":{"name":"bastien","@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7"},"headline":"Import a CSV file into a PHP array","datePublished":"2019-03-14T10:00:13+00:00","dateModified":"2019-03-02T10:48:41+00:00","mainEntityOfPage":{"@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/"},"wordCount":1497,"commentCount":0,"publisher":{"@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7"},"keywords":["CSV","Excel","Importer"],"articleSection":["PHP","WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/","url":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/","name":"Import a CSV file into a PHP array - Bastien Malahieude","isPartOf":{"@id":"https:\/\/bastienmalahieude.fr\/#website"},"datePublished":"2019-03-14T10:00:13+00:00","dateModified":"2019-03-02T10:48:41+00:00","breadcrumb":{"@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bastienmalahieude.fr\/en\/importer-un-fichier-csv-en-tableau-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/bastienmalahieude.fr\/"},{"@type":"ListItem","position":2,"name":"PHP","item":"https:\/\/bastienmalahieude.fr\/category\/php\/"},{"@type":"ListItem","position":3,"name":"Import a CSV file into a PHP array"}]},{"@type":"WebSite","@id":"https:\/\/bastienmalahieude.fr\/#website","url":"https:\/\/bastienmalahieude.fr\/","name":"Bastien Malahieude","description":"Growth Hacker - Web Developer - Project Manager","publisher":{"@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bastienmalahieude.fr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/59ad42a2add75f0f9af8e06f493841c7","name":"bastien","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/image\/","url":"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2017\/10\/bastien-3-carre-2.png","contentUrl":"https:\/\/bastienmalahieude.fr\/wp-content\/uploads\/2017\/10\/bastien-3-carre-2.png","width":"404","height":"404","caption":"bastien"},"logo":{"@id":"https:\/\/bastienmalahieude.fr\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":5,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":496,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/posts\/481\/revisions\/496"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/media\/489"}],"wp:attachment":[{"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bastienmalahieude.fr\/en\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}