QUEM TIVER INTERESSE ACESSE O LINK.
http://www.alvesbarb...nvert-text-php/
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Convert Text PHP</title>
<style type="text/css">
<!--
.cabecalho {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.nome {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
-->
</style>
</head>
<body>
<br />
<br />
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="cabecalho"> </td>
</tr>
<tr>
<td align="center" valign="top" class="cabecalho">CONVERT TEXT PHP 1.0.0</td>
</tr>
<tr>
<td align="center" valign="top" class="cabecalho">03-agosto-2010</td>
</tr>
<tr>
<td align="center" valign="top" class="cabecalho"> </td>
</tr>
<tr>
<td align="center" valign="top"><form action="Convert-Text.php" method="post">
<span class="nome">PALAVRA ORIGINAL</span><br />
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><input name="palavra" type="text" id="palavra" value="LIQUIDAÇÃO DE LUXO" size="60" maxlength="200" /></td>
</tr>
<tr>
<td align="center" valign="top" class="nome">Juntar Palavras?</td>
</tr>
<tr>
<td align="center" valign="top" class="nome"><label>
<input type="radio" name="juntar" id="radio3" value="sim" />
sim
</label>
<input name="juntar" type="radio" id="radio4" value="nao" checked="checked" />
não</td>
</tr>
<tr>
<td align="center" valign="top" class="nome">Separador <br />
(Digite o Separador Desejado "-", " ", "_" )</td>
</tr>
<tr>
<td align="center" valign="top"><label>
<input name="separador" type="text" id="separador" value="-" size="4" maxlength="6" />
</label></td>
</tr>
<tr>
<td align="center" valign="top" class="nome">Converte Para</td>
</tr>
<tr>
<td align="center" valign="top"><label>
<span class="nome">
<input type="radio" name="letra" id="radio" value="AAA" />
AAA </span></label>
<span class="nome">
<input name="letra" type="radio" id="radio2" value="aaa" checked="checked" />
aaa</span></td>
</tr>
</table>
<br />
<input name="Converter" type="submit" id="Converter" value="Converter" />
</form></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top" class="nome"><a href="convert-text-php.zip" target="_blank">Baixar Script</a></td>
</tr>
<tr>
<td align="center" valign="top" class="nome"><p>LEIA-ME (GRÁTIS)</p>
<p>COPIE OU DIGITE O TEXTO E OBTENHA ELE PRA O FORMATO WEB.</p>
<p>IDEAL PARA RENOMEAR ARQUIVOS PARA INTERNET.</p>
<p>POR EXEMPLO COLOQUE:<br />
"MINHA PÁGINA WEB.HTML"</p>
<p>E OBTERÁ A SAÍDA <br />
"minha-pagina-web.html".</p>
<p>AINDA COM A OPÇÃO DE SEPARADOR.</p>
<p>COMO O PROGRAMA TAMBÉM É POSSÍVEL FAZER O INVERSO.<br />
</p>
<p>www.alvesbarbosa.com/PROGRAMAS-PHP/convert-text-php</p></td>
</tr>
</table>
</body>
</html>Convert-Text.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Convert Text PHP</title>
</head>
<body>
<?php
$palavra = $_POST["palavra"];
$separador = $_POST["separador"];
$letra = $_POST["letra"];
$juntar = $_POST["juntar"];
function RemoveAcentos($str, $enc = "iso-8859-1"){
$acentos = array(
'A' => '/À|Á|Â|Ã|Ä|Å|À|Á|Â|Ã|Ä|Å|Æ /',
'a' => '/à|á|â|ã|ä|å|à|á|â|ã|ä|å|æ/',
'C' => '/Ç|Ç /',
'c' => '/ç|ç /',
'E' => '/È|É|Ê|Ë|È|É|Ê|Ë/',
'e' => '/è|é|ê|ë|è|é|ê|ë /',
'I' => '/Ì|Í|Î|Ï|Ì|Í|Î|Ï/',
'i' => '/ì|í|î|ï|ì|í|î|ï /',
'N' => '/Ñ|Ñ/',
'n' => '/ñ|ñ/',
'O' => '/Ò|Ó|Ô|Õ|Ö|Ò |Ó|Ô|Õ|Ö|×|Ø/',
'o' => '/ò|ó|ô|õ|ö|ð|ò|ó|ô|õ|ö|ø /',
'U' => '/Ù|Ú|Û|Ü/',
'u' => '/ù|ú|û|ü|Ù|Ú|Û|Ü /',
'Y' => '/Ý|Ý/',
'y' => '/ý|ÿ|ý/',
'a.' => '/ª|ª/',
'o.' => '/º|º/'
);
return preg_replace($acentos,
array_keys($acentos),
htmlentities($str,ENT_NOQUOTES, $enc));
}
$Min1 = RemoveAcentos("$palavra");
//MAIÚSCULAS E MINÚSCULAS
if($letra == "aaa") {
$Min2 = strtolower($Min1); }
if($letra == "AAA") {
$Min2 = strtoupper($Min1); }
//---------------------------------------
//SEPARADOR
if(($juntar == "nao") and empty($separador) ){
$Min3 = str_replace(" "," ","$Min2"); }
if(($juntar == "sim") and !empty($separador)) {
unset($separador);
$Min3 = str_replace(" ","$separador","$Min2"); }
if(($juntar == "sim") and empty($separador) ) {
unset($separador);
$Min3 = str_replace(" ","$separador","$Min2"); }
if(($juntar == "nao") and !empty($separador) ){
$Min3 = str_replace(" ","$separador","$Min2"); }
//--------------------------------------------------------
echo "$Min3";
?>
</body>
</html>
Edição feita por: superdanyboy, 03/08/2010, 21:08.










