Skip to content

How to convert string to int in PHP laravel?

$num = "3.14"; 
$int = (int)$num;//string to int
$float = (float)$num;//string to float
See also  Java code snippet - How to import borderlayout?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.