- strtoupper: documentation ( source)
- preg_replace: documentation ( source)
<?php
$string = "Gironde numérique";
$string = strtoupper($string);
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
$string = preg_replace('/\s+/', '_', $string);
echo "gn_" . $string;