an array in function serendipity_makeFilename

Discussion corner for Developers of Serendipity.
Post Reply
xutest
Posts: 4
Joined: Sun Nov 26, 2006 3:35 pm

an array in function serendipity_makeFilename

Post by xutest »

Code: Select all

function serendipity_makeFilename($str, $stripDots = false) {
    static $from = array(
                     ' ',

                     '?,
                     '?,

                     '?,
                     '?,

                     '?,
                     '?,

                     '?,

                     '?,
                     '?,
                     '?,

                     '?,
                     '?,
                     '?,

                     '?,
                     '?,
                     '?,
                     '?,

                     '?,
                     '?,
                     '?,
                     '?,

                     '?,
                     '?,
                     '?,

                     '?,
                     '?,

                     '?,

                     '?);

    static $to   = array(
                     '-',

                     'AE',
                     'ae',

                     'OE',
                     'oe',

                     'UE',
                     'ue',

                     'ss',

                     'e',
                     'e',
                     'e',

                     'i',
                     'i',
                     'i',

                     'a',
                     'a',
                     'a',
                     'a',

                     'o',
                     'o',
                     'o',
                     'o',

                     'u',
                     'u',
                     'u',

                     'c',
                     'C',

                     'n',

                     'y');
My english is poor,hope you can understand

I can't understand the array $from.

is it right in syntax?[/code]
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: an array in function serendipity_makeFilename

Post by garvinhicking »

Hi!

Have a look at http://www.php.net/str_replace.

$from and $to are variables passed to that function.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
xutest
Posts: 4
Joined: Sun Nov 26, 2006 3:35 pm

Post by xutest »

look at the array $from carefully,i think you are wrong

version 1.0.3

regards!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah, you mean the various "?" chars in the $frmo array? Those are not there in the real version; maybe the editor you are using does not support ISO-8859-1 characters...?

In the official release files, the $frmo array is alright!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply