Jump to content
php.lv forumi

Seostring funkcijas izpildē izmet error


nascar

Recommended Posts

Sveiki, tātad es savā lapā (topošajā) izmantoju 'seostring' funkciju...

Tātad ir situācija, piemēram es rakstu jaunuma nosaukumā piemēram 'Kaspars rulē' tad viss pievienojas ar seostring linku, bet ir brīži ka man piemeram rakstot nosaukumu 'Sūdzības', mans xampp izmet error - Apache error!

 

seostring funkcijas kods:

function seostring($title) {
 $characters = array(" ", "?", "!", "~", "`", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "]", "{", "}", ":", ";", "'", '"', '\"', "|", "<", ">", ",", ".", "?", "/");
 $replace =    array("-", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", '', '', "", "", "", "", "", "", "");
 $title = str_replace(
	array("ā", "Ā", "č", "Č", "ē", "Ē", "ģ", "Ģ", "ķ", "Ķ", "ļ", "Ļ", "ī", "Ī", "ū", "Ū", "š", "Š", "ņ", "Ņ", "ž", "Ž"), 
	array("a", "a", "c", "c", "e", "e", "g", "g", "k", "k", "l", "l", "i", "i", "u", "u", "s", "s", "n", "n", "z", "z"), 
$title
); 

 return strtolower(str_ireplace($characters, $replace, $title));
}

 

Ir kāds risinājums?

Kaspars.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...