sudhakarinfotech
(current)
Run Code
PHP Code Editor-
PHP Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Casting Of String To Integer</title> </head> <body> <h1>Casting Of String To Integer</h1> <?php $cost = '225'; $cost_value = (integer) $x; // cast $cost to int var_dump($cost_value); ?> </body> </html>
Source Code Output