Supprimer les caractères spéciaux de Word

function un_microsuck($text){
static $chars = array(
128 => '€', 130 => '‚', 131 => 'ƒ',
132 => '„', 133 => '…', 134 => '†',
135 => '‡', 136 => 'ˆ', 137 => '‰',
138 => 'Š', 139 => '‹', 140 => 'Œ',
142 => 'Ž', 145 => '‘', 146 => '’',
147 => '“', 148 => '”', 149 => '•',
150 => '–', 151 => '—', 152 => '˜',
153 => '™', 154 => 'š', 155 => '›',
156 => 'œ', 158 => 'ž', 159 => 'Ÿ'
);
$text = str_replace(array_map('chr', array_keys($chars)), $chars,
$text);
return $text;
}

Note : fonction copiée-collée d'ici et pas encore testée.

Upload de photos

<?php
$uploaddirectory = "upload/";
$photo = $_FILES['photo'];
if($photo['tmp_name'] != null)
{
$nom_photo = date("Y-m-d-H-i-s").".jpg";
$destination = $uploaddirectory.$nom_photo;
if($photo['type'] != "image/jpeg")
{ die("Pas la bonne extension"); }
elseif( !@is_uploaded_file($photo['tmp_name']) )
{ die("Upload erreur"); }
elseif (!@move_uploaded_file($photo['tmp_name'], $destination) )
{ die("Move erreur"); }
else
{ echo '<p>Upload ok de la photo : <img src="'.$uploaddirectory.$nom_photo.'"></p>'; }
}
?>
<form action="upload.php" enctype="multipart/form-data" method="post">
<input type="file" name="photo"/>
<input type="submit" value="upload"/>
</form>

Polaroid-o-nizer™

Mini boutons

Afficher et masquer une div

<script>
function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}
</script>
<a href="javascript:visibilite('divid');">afficher/masquer</a>
<div id="divid" style="display:none;">contenu</div>

[update ici]