Jump to content

How to find the number of a given location.


darkhorn

Recommended Posts

Or if you don't want to convert it over:

 

$var = 56781236;
$int = (int) (($var%10000)/1000); // $int = 1

 

Please note that if your var isn't big enough it will just show 0... and doing it as a string[ ] will produce undefined index (I believe) You should check to make sure your value is big enough before applying any of these techniques.

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.