Return the last 2 digits a number

后端 未结 6 1037
Happy的楠姐
Happy的楠姐 2021-01-11 15:00

How can I get the last 2 digits of:

200912

to my object:

$year = $flightDates-&         


        
6条回答
  •  梦谈多话
    2021-01-11 15:06

    For numbers, you could use php's modulo function (http://php.net/manual/en/internals2.opcodes.mod.php):

    departureDate->year;
    
    echo $year % 100;
    ?>
    

提交回复
热议问题