{"id":2193,"date":"2017-03-06T16:48:50","date_gmt":"2017-03-06T16:48:50","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=2193"},"modified":"2022-06-12T16:00:18","modified_gmt":"2022-06-12T16:00:18","slug":"generate-seo-friendly-url-from-title-string-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/","title":{"rendered":"Generate SEO Friendly URL from String in PHP"},"content":{"rendered":"<p>SEO friendly URLs are designed in a way where the URL slug is optimized for SEO. The use of the SEO-friendly URL helps to improve the search engine ranking. Also, the search engine friendly URL gives an idea about the web page content. The difference between a normal URL and SEO friendly URL is given below.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><b>Noraml URL:<\/b> https:\/\/www.example.com\/posts.php?id=123<\/li>\n<li><b>SEO URL:<\/b> https:\/\/www.example.com\/php-tutorial-for-beginners<\/li>\n<\/ul>\n<p>It clearly shows that the SEO URL is more human-friendly than the normal URL. From SEO URL the user can get a clear idea of what will be on the web page they are clicking. If you want to increase your website ranking on Search Engines and make it more user-friendly, you need to switch to an SEO-friendly URL. In this tutorial, we&#8217;ll show you how to <b>generate SEO friendly URL from string using PHP<\/b>.<\/p>\n<p>This example script makes it easy to convert title string to SEO-friendly URL in PHP. For better usability, we will create a custom PHP function to generate a clean and SEO friendly URL slug from string.<\/p>\n<p>In this tutorial, we&#8217;ll show you how to <b>generate SEO friendly URL from string using PHP<\/b>. Our example script makes it easy to convert title string to <b>SEO friendly URL in PHP<\/b>. We&#8217;ve grouped together all the PHP code into a function named <code>generateSeoURL()<\/code>. The <code>generateSeoURL()<\/code> function automatically create clean and SEO friendly URL slug from string.<\/p>\n<h2>Create SEO Friendly URL in PHP<\/h2>\n<p>The <code>generateSeoURL()<\/code> function automatically creates SEO friendly URL slug from the string using PHP. A title string needs to be passed as input and it returns a human-friendly URL string with a hyphen (<code>-<\/code>) as the word separator.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><code>$string<\/code> &#8211; Required. The string which you want to convert to the SEO friendly URL.<\/li>\n<li><code>$wordLimit<\/code> &#8211; Optional. Restrict words limit on SEO URL, default is 0 (no limit).<\/li>\n<\/ul>\n<pre><span style=\"color: #007700\">function&nbsp;<\/span><span style=\"color: #0000BB\">generateSeoURL<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$wordLimit&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$separator&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'-'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$wordLimit&nbsp;<\/span><span style=\"color: #007700\">!=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$wordArr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">explode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$string&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">implode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">array_slice<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$wordArr<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$wordLimit<\/span><span style=\"color: #007700\">)); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$quoteSeparator&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">preg_quote<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$separator<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'#'<\/span><span style=\"color: #007700\">); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$trans&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'&amp;.+?;'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'[^\\w\\d&nbsp;_-]'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'\\s+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$separator<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'('<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$quoteSeparator<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">')+'<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$separator <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$string&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">strip_tags<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(<\/span><span style=\"color: #0000BB\">$trans&nbsp;<\/span><span style=\"color: #007700\">as&nbsp;<\/span><span style=\"color: #0000BB\">$key&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$val<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$string&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">preg_replace<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'#'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$key<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'#iu'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$val<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$string&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">strtolower<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">trim<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">trim<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$string<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$separator<\/span><span style=\"color: #007700\">)); <br \/>}<\/span><\/pre>\n<h2>Uses<\/h2>\n<p>Use the <code>generateSeoURL()<\/code> function to generate SEO friendly URL from title string using PHP. Provide the article title or string in the first parameter of generateSeoURL() function. If you want to restrict words on the URL, provide the number of the words otherwise can omit it.<br \/>\n<b>Without Words Limit:<\/b><\/p>\n<pre><span style=\"color: #0000BB\">$postTitle&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'Generate&nbsp;SEO&nbsp;Friendly&nbsp;URL&nbsp;from&nbsp;String&nbsp;in&nbsp;PHP'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #0000BB\">$seoFriendlyURL&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">generateSeoURL<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postTitle<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Output&nbsp;will&nbsp;be:&nbsp;generate-seo-friendly-url-from-string-in-php<\/span><\/pre>\n<p><b>With Words Limit:<\/b><\/p>\n<pre><span style=\"color: #0000BB\">$postTitle&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'Generate&nbsp;SEO&nbsp;Friendly&nbsp;URL&nbsp;from&nbsp;String&nbsp;in&nbsp;PHP'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #0000BB\">$seoFriendlyURL&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">generateSeoURL<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$postTitle<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">4<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Output&nbsp;will&nbsp;be:&nbsp;generate-seo-friendly-url<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SEO friendly URLs are designed in a way where the URL slug is optimized for SEO. The use of the SEO-friendly URL helps to improve the search engine ranking. Also, the search engine friendly URL <\/p>\n","protected":false},"author":1,"featured_media":4981,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[14,260,261],"class_list":["post-2193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php","tag-seo","tag-url","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Generate SEO Friendly URL from String in PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.\" \/>\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.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generate SEO Friendly URL from String in PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-06T16:48:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-12T16:00:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Generate SEO Friendly URL from String in PHP\",\"datePublished\":\"2017-03-06T16:48:50+00:00\",\"dateModified\":\"2022-06-12T16:00:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/\"},\"wordCount\":369,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generate-seo-friendly-url-from-string-using-php-codexworld.png\",\"keywords\":[\"PHP\",\"SEO\",\"URL\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/\",\"name\":\"Generate SEO Friendly URL from String in PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generate-seo-friendly-url-from-string-using-php-codexworld.png\",\"datePublished\":\"2017-03-06T16:48:50+00:00\",\"dateModified\":\"2022-06-12T16:00:18+00:00\",\"description\":\"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generate-seo-friendly-url-from-string-using-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/generate-seo-friendly-url-from-string-using-php-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"generate-seo-friendly-url-from-string-using-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/generate-seo-friendly-url-from-title-string-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate SEO Friendly URL from String in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Generate SEO Friendly URL from String in PHP - CodexWorld","description":"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.","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.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/","og_locale":"en_US","og_type":"article","og_title":"Generate SEO Friendly URL from String in PHP - CodexWorld","og_description":"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.","og_url":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2017-03-06T16:48:50+00:00","article_modified_time":"2022-06-12T16:00:18+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Generate SEO Friendly URL from String in PHP","datePublished":"2017-03-06T16:48:50+00:00","dateModified":"2022-06-12T16:00:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/"},"wordCount":369,"commentCount":5,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","keywords":["PHP","SEO","URL"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/","url":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/","name":"Generate SEO Friendly URL from String in PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","datePublished":"2017-03-06T16:48:50+00:00","dateModified":"2022-06-12T16:00:18+00:00","description":"Create SEO friendly URL in PHP - PHP function to generate search engine friendly URLfrom string using PHP. Create clean and SEO friendly URL from string using generateSeoURL() function.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","width":1366,"height":768,"caption":"generate-seo-friendly-url-from-string-using-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/generate-seo-friendly-url-from-title-string-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Generate SEO Friendly URL from String in PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/03\/generate-seo-friendly-url-from-string-using-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-zn","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=2193"}],"version-history":[{"count":5,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2193\/revisions"}],"predecessor-version":[{"id":4980,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2193\/revisions\/4980"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/4981"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=2193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=2193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=2193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}