fork download
  1. <?php
  2.  
  3. $string = (int) 'Muitas casas';
  4.  
  5. var_dump( $string ); // int(0)
  6.  
  7. $string2 = (int) '10 casas aproximadamente';
  8.  
  9. var_dump( $string2 ); // int(10)
  10.  
  11. $string3 = (int) 'Exatamente 10 casas';
  12.  
  13. var_dump( $string3 ); // int(0)
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
int(0)
int(10)
int(0)