小编use*_*087的帖子

PHP检查url参数是否存在

我有一个URL,我将参数传递给

例如/ success.php?ID = LINK1

我用php来抓住它

$slide = ($_GET["id"]);
Run Code Online (Sandbox Code Playgroud)

然后是一个if语句来显示基于参数的内容

<?php  if($slide == 'link1') { ?>
   //content
 } ?>
Run Code Online (Sandbox Code Playgroud)

只需要知道在PHP中如何说,如果url param存在抓住它并执行if函数,如果它不存在则什么都不做.

多谢你们

php url url-parameters

48
推荐指数
3
解决办法
13万
查看次数

WC_Order get_items()及其数量

我正在尝试构建一个应用程序,它将我的商业订单,订单商品和数量发给我,

我90%在那里,

function custom_woocommerce_complete_order_sms( $order_id ) {
        global $woocommerce;
        if ( !$order_id )
        return;
        $order = new WC_Order( $order_id );

        $product_list = '';
        $order_item = $order->get_items();

        foreach( $order_item as $product ) {
            $prodct_name[] = $product['name']; 
        }

        $product_list = implode( ',\n', $prodct_name );






    require "twilio-php-master/Services/Twilio.php";


    $AccountSid = "xxxxxxxxx";
    $AuthToken = "xxxxxxxxx";

    $client = new Services_Twilio($AccountSid, $AuthToken);


    $people = array(
        "xxxxxxxxxx" => "Me",
    );


    foreach ($people as $number => $name) {

        $sms = $client->account->messages->sendMessage(



            "+44xxxxxxxxxx", 

            // the number we are sending to …
Run Code Online (Sandbox Code Playgroud)

php woocommerce

7
推荐指数
1
解决办法
4万
查看次数

ngstyle 的多个条件

如果可能的话我想为 ng 风格添加多个条件

目前我像这样设置宽度和颜色

[ngStyle]="{
              'width': (question.score.toFixed(1) * 10)+'%', 
              'background-color': question.score.toFixed(1) < 3 ?'red' : '#00c9c7' 
              }"
Run Code Online (Sandbox Code Playgroud)

不过我想得分低于 3 的为红色,高于 7 的为绿色。这种情况下,3 岁以下的颜色为红色,其他颜色为绿松石色。ng风格可以添加多个条件吗?

angularjs

4
推荐指数
1
解决办法
4113
查看次数

标签 统计

php ×2

angularjs ×1

url ×1

url-parameters ×1

woocommerce ×1