Php 语法错误:意外';其他';

Php 语法错误:意外';其他';,php,stripe-payments,Php,Stripe Payments,我是一名PHP新手,遇到以下错误: 解析错误:语法错误,第33行的/home/stripeparse/example.com/create_customer.php中出现意外的“else”(T_else) <?php require_once('/Stripe/lib/Stripe.php'); Stripe::setApiKey("APIKEY"); try { Stripe_Customer::create( array( "description" =

我是一名PHP新手,遇到以下错误:

解析错误:语法错误,第33行的/home/stripeparse/example.com/create_customer.php中出现意外的“else”(T_else)

<?php

require_once('/Stripe/lib/Stripe.php');
Stripe::setApiKey("APIKEY");

try
{

    Stripe_Customer::create( array(

        "description" => $mobile,

        "email" => $email

    ));

    $SUCCESS = 'SUCCESS';

    $response = json_encode(array('result'=>'SUCCESS','customerID'=>$customer->id));

    array_push($jsonarray, $response);

}

catch (Exception $e)
{
    $response = $e -> getMessage(); 

    array_push($jsonarray,$response);

}

else
{

    $response = json_encode(array('result' => 'DATA = FALSE'))

}

print_r($response);

?>

我做错了什么


提前感谢您的帮助。

您之所以会出现此错误,是因为您将语句放在了语句后面。语句只能放在or语句后面。

随机else条件

else
{
    $response = json_encode(array('result' => 'DATA = FALSE'))
}
只用

$response = json_encode(array('result' => 'DATA = FALSE'))

else
需要一个
if
…从代码中删除else或添加if语句
try/catch/else
不是有效的构造。。。。您的意思是
try/catch/finally
else
不带
if
?您希望
else
始终运行,还是仅当
catch
未触发时才运行?