doubaolan2842 2011-07-12 02:47
浏览 36
已采纳

在javascript中添加php函数

I have a file for a calendar made with javascript called calendar_db.js, in it there is this if statment:

        if (d_current.getDay() != 3 && d_current.getDay() != 6)
            a_class[a_class.length] = 'available';

it checks if the day is not the 3d or the 6th then. So my question is how to make a php mysql query to get those numbers (3 and 6) because I want to change them with mysql databse. What are your suggestions?

Thank you for your time and help.

  • 写回答

3条回答 默认 最新

  • doujiangqu2823 2011-07-12 02:52
    关注

    EDIT:

    Read the javascript file by using fopen(), file_get_contents(), or CURL:

    http://www.php-mysql-tutorial.com/wikis/php-tutorial/reading-a-remote-file-using-php.aspx

    Use some kind of regex to parse the javascript file looking for the particular match of the line with your values. If your javascript file isn't going to change much, it might be easier to just count lines and characters and get the number at exactly some position. This assumes your numbers will always be single digits.

    Is this what you're after?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?