<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
function optimizeString($String):string {
  //echo $String;
  if (!empty($String) AND !is_null($String) && is_string($String)) {
    //echo " ~~~ IF ";
    if (strpos($String, '-')===0)
      $String = substr($String, 1);
    $String = str_replace("&amp;","&",$String);
    $String = str_replace("&gt;",">",$String);
    $String = str_replace("´","'",$String);
    $String = str_replace('"','""',$String);
    $String = str_replace('&quot;','""',$String);
    $String = str_replace("&#039;","'",$String); }
  //echo "<br>";
  return '"'.$String.'"'; }