note 102979 added to function.utf8-encode

From: Date: Thu, 17 Mar 2011 22:29:21 +0000
Subject: note 102979 added to function.utf8-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-177969@lists.php.net to get a copy of this message
hello, utf-8 is good for yours for arabic urls like http://games.astaza.com/العاب/ after use utf8_enocde and urlencode will http://games.astaza.com/%D8%A7%D9%84%D8%B9%D8%A7%D8%A8/ thats better for seo and all browsers this is my solutions for convert arabic text to utf8 and encode it function create_url($str) { //$str = preg_replace('/\&#\d+\;/', "", $str); $str = preg_replace('#\s+#', '-', trim(strtolower($str))); $str = utf8_encode($str); $str = urlencode($str); return $str; } thanks ---- Server IP: 69.147.83.197 Probable Submitter: 41.178.248.12 ---- Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php Edit -- https://master.php.net/note/edit/102979 Del: integrated -- https://master.php.net/note/delete/102979/integrated Del: useless -- https://master.php.net/note/delete/102979/useless Del: bad code -- https://master.php.net/note/delete/102979/bad+code Del: spam -- https://master.php.net/note/delete/102979/spam Del: non-english -- https://master.php.net/note/delete/102979/non-english Del: in docs -- https://master.php.net/note/delete/102979/in+docs Del: other reasons-- https://master.php.net/note/delete/102979 Reject -- https://master.php.net/note/reject/102979 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177969) next »