我有以下代码,从今天的日期开始返回接下来的13个星期一.
for($i=1; $i<=13; $i++){
echo date("Y-m-d", strtotime('+'.$i.' Monday'))."<br>";
}
Run Code Online (Sandbox Code Playgroud)
我希望能够修改它,这样它不仅可以显示接下来的13个星期一,还可以显示刚刚过去的星期一.
我尝试修改代码如下,但我得到下一个星期一返回的两个实例.
for($i=-1; $i<=13; $i++){
echo date("Y-m-d", strtotime('+'.$i.' Monday'))."<br>";
}
Run Code Online (Sandbox Code Playgroud)
数据已返回.
2015-04-13
2015-04-20 //<--
2015-04-20
2015-04-27
2015-05-04
2015-05-11
2015-05-18
2015-05-25
2015-06-01
2015-06-08
2015-06-15
2015-06-22
2015-06-29
2015-07-06
2015-07-13
Run Code Online (Sandbox Code Playgroud)
关于我如何实现这一点的任何想法?
我有以下MySQL查询:
select
members_categories.category_desc as 'membership_type',
SUM( CASE payment_method WHEN 'Bank Transfer' THEN amount_paid ELSE 0 END ) AS 'Bank Transfer',
SUM( CASE payment_method WHEN 'Cash' THEN amount_paid ELSE 0 END ) AS 'Cash',
SUM( CASE payment_method WHEN 'Cheque' THEN amount_paid ELSE 0 END ) AS 'Cheque',
SUM( CASE payment_method WHEN 'Credit Card' THEN amount_paid ELSE 0 END ) AS 'Credit Card',
SUM( CASE payment_method WHEN 'Direct Debit' THEN amount_paid ELSE 0 END ) AS 'Direct Debit',
SUM( CASE payment_method WHEN …Run Code Online (Sandbox Code Playgroud) 我有一个表单,其中一个表单字段如下:
<input type="email" id="email" name="email" required>
Run Code Online (Sandbox Code Playgroud)
我在表单底部有一个提交按钮,可以调用javascript并加载Stripe Checkout.
<input type="button" id="charge-button" class="button radius member_button" value="Continue">
Run Code Online (Sandbox Code Playgroud)
Javascript调用Stripe.
<script src="https://checkout.stripe.com/checkout.js"></script>
<script>
var handler = StripeCheckout.configure({
key: '<?php echo $stripe['publishable_key']; ?>',
image: '/img/documentation/checkout/marketplace.png',
locale: 'auto',
token: function(token) {
// You can access the token ID with `token.id`.
// Get the token ID to your server-side code for use.
$.post("", {token: token, type: 'charge'}, function(res){
if(res.status){
$('form').submit();
}
},"json");
console.log(token);
}
});
$('#charge-button').on('click', function(e) {
handler.open({
image: '/logo.png',
name: 'Shop.com',
description: 'Product',
email: 'example@email.com', …Run Code Online (Sandbox Code Playgroud) 我有以下代码,并为纯色叠加颜色添加了不透明度。问题是文本也在使用不透明度。如何更改它以使文本没有不透明度并位于顶部?
.container {
position: relative;
width: 50%;
}
.image {
display: block;
width: 100%;
height: auto;
}
.overlay {
position: absolute;
bottom: 100%;
left: 0;
right: 0;
background-color: #008CBA;
opacity: .5;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.container:hover .overlay {
bottom: 0;
height: 100%;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<img src="https://cdn.searchenginejournal.com/wp-content/uploads/2019/07/the-essential-guide-to-using-images-legally-online-1520x800.png" class="image">
<div class="overlay"> …Run Code Online (Sandbox Code Playgroud)