Jump to content

[SOLVED] Ints in speech marks?


Epidemic

Recommended Posts

by speech marks you mean quotes?  No, for the most part, php is a loosely typed language. It automatically converts data types as necessary.

 

<?php

$x = 10000; // initially considered an int
echo 5 * $x; // output 50000

$x = "10000"; // initially considered as a string
echo 5 * $x; // will still output 50000

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.