Jump to content
Fórum Script Brasil
  • 0

Me Ajudem Com A Função "Array_Unique" Do Php Só Pra Quem Man


overflow

Question

<?

//CONTEÙDO DO BANCO DE DADOS ***(conteudo.php)***

/*

1317497744|Linha A|001|

1317497728|Linha B|002|

1317497729|Linha B|002|

1317494574|Linha D|003|

1317494566|Linha C|004|

1317494562|Linha E|005|

*/

?>

<?

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

$db_conteudo = file("./conteudo.php"); //Caminho do banco de dados

$filtrar_linha="1";

function filtro($a, $b){

global $db_conteudo, $filtrar_linha;

$id_a = explode('|', $db_conteudo[$a]);

$id_b = explode('|', $db_conteudo[$b]);

return strnatcasecmp($id_a[$filtrar_linha], $id_b[$filtrar_linha]);}

uksort($db_conteudo, 'filtro');

foreach($db_conteudo as $conteudo_linha){

$conteudo_linha = explode("|",$conteudo_linha);

echo"$conteudo_linha[1]<br>";}

//$db_conteudo = array_unique($db_conteudo);

//$db_conteudo = array_unique(array_diff_assoc($db_conteudo, array_unique($db_conteudo)));

//COMO FAÇO PARA USAR A FUNÇÃO ARRAY_UNIQUE PARA QUE NÃO APAREÇA O CONTEÚDO DUPLICADO NESTE SCRIPT???????

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

?>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...