converting string to int php 8 code example Example 1: php string to int intval($string); Example 2: Convert a String to a Number in PHP phpCopyintval( $StringName );