Jump to content

[SOLVED] Counting first 2 left numbers


phpnewbie112

Recommended Posts

example........

<?php

$num=19234455677654;

$x=substr($num,0,2);

if($x=="19"){

echo"the numbers of $num has number $x at the beging ";

}else{

echo wrong ;

}
?>

 

 

short way

<?php

$num=19234455677654;

if(substr($num,0,2)=="19"){

echo"the numbers of $num has number $x at the beging ";

}else{

echo wrong ;

}
?>

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.