Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess and utf-8

    hello! I have a problem with utf-8 ...

    In horizontalmenu.php I have:

    Code:
     print '<a href="/calcioitalia/coaches/'.$name.'.html').'">'.$name.'</a>';
    where

    Code:
    $name=José Mário
    and in .htaccess I have

    Code:
    AddDefaultCharset UTF-8
    AddCharset UTF-8 .html
    and doesn't work...

    How could I solve this problem? Thank u!

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it works, but I have a problem in this situation:

    Code:
    print '<a href="/calcioitalia/teams/'.seoUrl($numele.' '.$id_squadra.'.html').'">'.$nume.'</a>';
    with $numele='José Mário'

    where

    Code:
    function seoUrl($string) {
            //Unwanted:  {UPPERCASE} ; / ? : @ & = + $ , . ! ~ * ' ( )
          //  $string = strtolower($string);
            //Strip any unwanted characters
            $string = preg_replace("/[^A-Za-z0-9._\s-]/", "", $string);
            //Clean multiple dashes or whitespaces
            $string = preg_replace("/[\s-]+/", " ", $string);
            //Convert whitespaces and underscore to dash
            $string = preg_replace("/[\s_]/", "-", $string);
        
            return $string;
    }
    so, how could I solve the problem?

    Thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •