Tutorial: Como fazer feeds RSS de outros sites/Usando PHP/acentuacao.php

De Projeto RSSficado 2

Voltar para o artigo principal: Como fazer feeds RSS de outros sites/Usando PHP

<?php
// From: http://www.webmasternetwork.se/index.php?s=wn&act=ST&f=4&t=19751
define( "UC_CHARS", "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕ֌؊ÙÚÛÜÝŽÞ" ); // If you need more, add
define( "LC_CHARS", "àáâãäåæçèéêëìíîïðñòóôõöœøšùúûüýžþ" ); // If you need more, add
define( "WORD_SEPARATORS", chr(9).chr(10).chr(11).chr(12).chr(13).chr(32) );
 
function strtolower2($value) {
 return (
  strtolower(
    strtr( $value, UC_CHARS, LC_CHARS )
  )
 );
}
 
function strtoupper2($value) {
 return (
  strtoupper(
    strtr( $value, LC_CHARS, UC_CHARS )
  )
 );
}
 
function ucfirst2($value) {
 return (
  strtoupper2(
    substr( $value, 0, 1 )
  ).strtolower2(
    substr( $value, 1, strlen( $value ) )
  )
 );
}
 
function ucwords2( $value ) {
 $upper = strtoupper2( $value );
 $value = ucfirst2( $value );
 $word_separators = WORD_SEPARATORS;
 $len = strlen( $value ) - 1;
 for ( $i = 0; $i < strlen( $word_separators ); $i++ ) {
  $separator = $word_separators[$i];
  $pos = -1;
  while ( $pos !== false ) {
    $pos = strpos( $value, $separator, ( $pos + 1 ) );
    if ( ( $pos !== false ) && ( $pos < $len ) ) {
      $value[ ( $pos + 1 ) ] = $upper[ ( $pos + 1 ) ];
    }
  }
 }
 return ($value);
}
 
?>
Ferramentas pessoais