duanping1920
duanping1920
2009-08-08 00:20

在PHP中使用AWK的`-F,'{print $ 1}'

已采纳

I run unsuccessfully

$cookie = "masi@gmail.com,777";
$cookie_tripped = trim(",", $_COOKIE['login']);
echo "Cookie: "$cookie_tripped[0];     

It gives me

Cookie: 

How can you do the following command in PHP?

 awk -F, '{ print $1 }'
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • douyiavxxh02727 douyiavxxh02727 12年前
    $cookie = "masi@gmail.com,777";
    $cookie_tripped = explode(",", $cookie);
    echo "Cookie: " . $cookie_tripped[0];
    
    点赞 评论 复制链接分享