Modifier le type d’une variable

Author:


Download

<?php

  $inconnu = 2011;
  echo gettype ($inconnu) . "<br />";

  if (is_int ($inconnu)){
   $inconnu+=1;
    echo "Année incrémentée de 1: $inconnu<br />";
  }

  $annee = " Année2011";
  // modifier le type de la variable
  $annee = settype ($annee ,"string");
  echo "Bonne".$annee . "<br />";

  echo (string) $annee;

?>

Leave a Reply

Your email address will not be published. Required fields are marked *


+ four = 10