[EMAIL PROTECTED] schrieb:
> Em Terça 28 Agosto 2007 19:04, [EMAIL PROTECTED] escreveu:
>> Em Terça 28 Agosto 2007 12:54, noskule escreveu:
>>
>> Have you tried ucfirst() function?
>>
>>  $MarkupExpr['removespace'] = 'RemoveSpace($args[0])';
>>
>>  function RemoveSpace($in) {
>>      $out = ucfirst($in);
>>         $out = str_replace(" ","" ,$out);
>>         return  $out;
>>  }
> 
> Oops!
>  I meant ucwords() function.
> 
>   $MarkupExpr['removespace'] = 'RemoveSpace($args[0])';
> 
>   function RemoveSpace($in) {
>       $out = ucwords($in);
>          $out = str_replace(" ","" ,$out);
>          return  $out;
>   }
> 

hi carlos
thanks for the code. I checked it and it worked for removing spaces and
capitalize the letter after the space. But special chars are not
removed, so I added a preg-replace

$MarkupExpr['wikiword'] = 'WikiWord($args[0])';

function WikiWord($in) {
        $out = ucwords($in);
        $out = str_replace(" ","" ,$out);
        $out = preg_replace("/[^-\d\w]*/","",$out);
        return  $out;
}

so far I tested it works, do you think its ok or could it made easyer
grz nos

> _______________________________________________
> pmwiki-users mailing list
> [email protected]
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
> 


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to