我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP获得x金额并插入休息

I am currently creating a script that need to take each 100 amount and add "1" to the row "days". I wanted to divide the amount by 100. So 100/100=1, but if i get a number with 150 it would become 150/100=1.5. These extra 50 in the 150 number needs to be put to the side (going into another row). And there cannot be any decimals in the row "days".

What is the smartest/simplest way to do this?

Some code:

$amount = 150;
$days = $amount/100; //no decimals here
//update

Solution I found the solution to my question:

echo $amount%100;

近期文章

  • 如何在php中显示视频网址?
  • 更改12:00 s到00:00:00 php sql
  • 意外的文件结束; 括号错位?
  • 从2个表中选择数据
  • MYSQL PHP查询不插入数据
  • while循环和implode()函数
  • 在Javascript中调用PHP数据库变量
  • 如何开始Magento为Drupal开发人员?
  • 按网页上的按钮 - >在手机上获取通知[关闭]
  • 用php逐行创建文本文件
  • 使用PHP MySQL的文本版本控制系统
  • 正则表达式检查垃圾邮件发送者
  • 如何将数据库mysql中的url放到php中的地址栏浏览器中
  • (PHP)如果变量等于HTML输出,请执行此操作
  • Php在进行计算时得到实际结果
  • 如何获取使用我们的脚本或Web应用程序的网站的名称
  • 如何从数据库MySQL中检索值
  • 为什么即使单元格正确更新,我也会收到MySQL语法错误?
  • 如何使用preg_match只允许包含字母和数字字符的字符串?
  • 将代码拆分为某些变量

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华