anonīms Posted December 10, 2008 Report Posted December 10, 2008 Ideja ir tāda, ka ja caur admin paneli mēģina izveidot izvēlnes linku, teiksim, Arājs, tad db nonāk link_src, kur būtu arajs Arājs => arajs manā lapā => mana_lapa Nevēlos izvelni ar id veidot. Pārāk bezpersoniski. Kā to varētu panākt?
codez Posted December 10, 2008 Report Posted December 10, 2008 $s='āčēģīķļņšūž?'; $s=iconv('UTF-8','ASCII//TRANSLIT',$s); echo $s; Jāpievieno vēl tikai atstarpes aizvietošana ar _
Toms Posted December 10, 2008 Report Posted December 10, 2008 $lielie = array('Ā','ā','Č','č','Ē','ē','Ģ','ģ','Ī','ī','Ķ','ķ','Ļ','ļ','Ņ','ņ','Š','š','Ū','ū','Ž','ž','ō','Ō',' ','Æ','æ','Ø','ø','Å','å'); $mazie = array ('a','a','c','c','e','e','g','g','i','i','k','k','l','l','n','n','s','s','u','u','z','z','o','o',' ','ae','ae','o','o','aa','aa'); $url = strtolower(str_replace($lielie,$mazie,$string));
marcis Posted December 10, 2008 Report Posted December 10, 2008 (edited) es linkus veidoju šādi function fuckchars($str){ $chars=array('ā"=>"a","č"=>"c","ē"=>"e","ģ"=>"g","ī"=>"i","ķ"=>"k","ļ"=>"l","ņ"=>"n","š"=>"s","ū"=>"u","ž"=>"z"," "=>"_",); $str=strtolower($str); $str=strtr($str,$chars); $str=ereg_replace("[^a-z0-9_]","",$str); return $str; } Edited December 10, 2008 by marcis
Recommended Posts