Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 79 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
79 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eRibo.                                                                          |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
160 jpm 24
// CVS : $Id: eribo_encodage.fonct.php,v 1.2 2005-03-15 12:18:30 jpm Exp $
79 jpm 25
/**
26
* Fonctions manipulant les encodages
27
*
28
* Fichiers contenant des fonctions manipulant l'encodage.
29
*
30
*@package eRibo
31
*@subpackage Fonctions
32
//Auteur original :
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
34
//Autres auteurs :
35
*@author        Aucun
36
*@copyright     Tela-Botanica 2000-2004
160 jpm 37
*@version       $Revision: 1.2 $ $Date: 2005-03-15 12:18:30 $
79 jpm 38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            LISTE DES FONCTIONS                                       |
48
// +------------------------------------------------------------------------------------------------------+
49
 
50
/**
51
* La fonction remplaceEntiteHTLM() remplace des caractères par les entités html.
52
*
53
* Cette fonction retourne un texte dans lequel touts les caractères correspondant
54
* à des entités html sont remplacés par la valeur de l'entité, à l'exception
55
* des caractères <, >, & et ".
56
* Cela permet de remplacer toutes les entités dans une chaine contenant du html.
57
*
58
*@param string la chaîne html à parsser.
59
*@return string contient la chaîne html avec les entités intégrées.
60
*/
61
 
62
function remplaceEntiteHTLM($texte)
63
{
64
    $texte_retour = '';
65
    $tab_entites = get_html_translation_table(HTML_ENTITIES);
66
    unset($tab_entites['"']);
67
    unset($tab_entites['<']);
68
    unset($tab_entites['>']);
69
    unset($tab_entites['&']);
160 jpm 70
    $tab_entites[' & '] = ' &amp; ';
79 jpm 71
    return strtr($texte, $tab_entites);
72
}
73
 
74
// +------------------------------------------------------------------------------------------------------+
75
// |                                            PIED du PROGRAMME                                         |
76
// +------------------------------------------------------------------------------------------------------+
77
 
78
 
79
 
80
/* +--Fin du code ----------------------------------------------------------------------------------------+
81
*
82
* $Log: not supported by cvs2svn $
160 jpm 83
* Revision 1.1  2005/01/18 12:14:24  jpm
84
* Ajout d'un fichier contenant une fonction permettant d'attribuer des entités html à la place des caractères non impliqués dans le HTML.
79 jpm 85
*
160 jpm 86
*
79 jpm 87
* +-- Fin du code ----------------------------------------------------------------------------------------+
88
*/
89
?>