小编Cha*_*les的帖子

解析错误:语法错误wordpress

我有以下错误:

解析错误:语法错误,意外T_STRING,期待','或';' 在第64行的../public_html/wp-content/themes/nano/includes/galleri.php**

请帮助我让我的代码工作!

http://pastebin.com/B0ndywWc

有问题的代码:

<?php
    $ccfit_img_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'ccfit_thumb', false );
    $ccfit_img_big = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'ccfit_big', false );

    echo '
        <div class="col-md-4">
        <div class="inner">
        <a href="'. $ccfit_img_big[0] .'"></a>
        <img src="'. $ccfit_img_thumb[0] .'">
        <h2>'. get_the_title() .'</h2>
        <p>'. get_the_content() .'</p>
        <hr>
        <?php
          if (isset($featuredImages) && is_array($featuredImages)) {
            foreach($featuredImages as $images) {
                $thumb = $images['thumb']; // <---- line 64
                $fullImage = $images['full'];
                print ' <a class="fancybox" href="'. $fullImage .'" style="text-align:center">&laquo; Take a look &raquo;</a> ';
            } …
Run Code Online (Sandbox Code Playgroud)

php wordpress wordpress-plugin

-3
推荐指数
1
解决办法
342
查看次数

为什么我的编辑器没有突出显示我的所有PHP代码?

在我的代码编辑器中,它通常以粗体蓝色打印显示PHP代码.我发现我的一些代码没有显示为粗体蓝图.有人可以看看下面的代码并告诉我,如果我做错了什么?提前致谢.

    <td class="hr"><?php echo htmlspecialchars("payroll number")."&nbsp;" ?></td>
    <td class="dr"><input type="text" name="GevityNo" maxlength="10" value="<?php echo str_replace('"', '&quot;', trim($row["GevityNo"])) ?>"></td>
</tr>
<tr>
    <td class="hr"><?php echo htmlspecialchars("employee name")."&nbsp;" ?></td>
    <td class="dr"><textarea cols="25" rows="1" name="employee_name" maxlength="75"><?php echo str_replace('"', '&quot;', trim($row["employee_name"])) ?></textarea></td>
</tr>
<tr>
    <td class="hr"><?php echo htmlspecialchars("Sex")."&nbsp;" ?></td>
    <td class="dr"><select name="Sex">
    <option value=""></option>
    <?php
        $lookupvalues = array("male","female");
        reset($lookupvalues);
        foreach($lookupvalues as $val){
            $caption = $val;
            if ($row["Sex"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
            ?>
            <option value="<?php echo $val ?>"<?php …
Run Code Online (Sandbox Code Playgroud)

php syntax-highlighting

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

未定义的变量

我已经定义了2个变量,包括联系人和衬衫.正如你所看到的那样,他们也在标题中.我仍然得到两个变量都未定义的消息.

我收到此错误消息:

(!)SCREAM:忽略(!)的错误抑制

注意:未定义的变量:第17行的C:\ wamp\www\Test\shirts4mike\inc\header.php中的部分

调用堆栈#TimeMemoryFunctionLocation 10.0003243592 {main}()..\index.php:0

20.0006246920 include('C:\ wamp\www\Test\shirts4mike\inc\header.php')..\index.php:3">

第18行也是如此.

shirts.php:

     <?php
            $pageTitle = "Mike's Full Catalog of Shirts";
            $section = "shirts";
            include('inc/header.php'); ?>

                    <div class="section page">
                            <h1>Mikes&rsquo;s Full Catalog of Shirts</h1>
                    </div>

            <?php include ('inc/footer.php'); ?>
Run Code Online (Sandbox Code Playgroud)

contact.php:

<?php
    $pageTitle = "Contact Mike";
     $section = "contact";
     include('inc/header.php'); ?>

           <div class="section page">

           <h1>Contact</h1>

           </div>


<?php include ('inc/footer.php'); ?>
Run Code Online (Sandbox Code Playgroud)

header.php:

<html>
        <head>
                <title> <?php echo $pageTitle ?></title>
                <link rel="stylesheet" href="css/style.css" type="text/css">
                <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css">
                <link rel="shortcut …
Run Code Online (Sandbox Code Playgroud)

php variables xdebug

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

将数组拆分为子数组

我有一组移动数字,它包含9000个数字或有时更多.

我想将此数组拆分为子数组,每个数组只应有3000个数字并将它们传递给函数:

function sendSMS($mobilenumbers){

//some code here

}
Run Code Online (Sandbox Code Playgroud)

谢谢

php arrays

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

表单 Google 脚本防止重复

我正在制作一个谷歌表单,有一个名为 name 的字段,其中包含其他字段,如标题、公司和电子邮件地址。如果数据库中已经有一个特定的人,我希望其他信息用新信息替换旧信息(即更新功能),但我在使用 Google Apps 脚本时遇到麻烦,因为我找到了文档相当可悲。有人介意帮我一下吗?

google-apps-script google-forms

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

Perl one-liner with -pl命令行选项

我在跑

perl -ple '$_=length' datafile
Run Code Online (Sandbox Code Playgroud)

数据文件包含以下内容:

algorithm
student government
Fiumichino
Run Code Online (Sandbox Code Playgroud)

结果是它打印出来

9
18
10
Run Code Online (Sandbox Code Playgroud)

-p和-l选项有什么作用?还有,是什么$_

perl command-line-arguments

-5
推荐指数
1
解决办法
409
查看次数

对于使用float作为计数器的循环,增加0.01,不会打印预期的浮点值

for (float x = 0.00; x < 1.00; x += 0.01) {
    cout << x << endl;
}
Run Code Online (Sandbox Code Playgroud)

我预计

0.00
0.01
0.02
...
Run Code Online (Sandbox Code Playgroud)

它工作正常,直到 0.83:

...
0.81
0.82
0.83
0.839999
0.849999
0.859999
0.869999
0.879999
0.889999
0.899999
0.909999
0.919999
0.929999
0.939999
0.949999
0.959999
0.969999
0.979999
0.989999
0.999999
Run Code Online (Sandbox Code Playgroud)

那部分怎么了?为什么所有额外的9s?

c++ floating-point

-5
推荐指数
1
解决办法
1万
查看次数

> =操作数不能应用于Bool和Float类型

我有这个长篇大论.它给了我错误

>= Operand cannot be applied to types Bool and Float

if (tl.State == TouchLocationState.Pressed && 
    (tl.Position.X >= harePlayer.Position.X >= tl.Position.X && 
     tl.Position.Y >= harePlayer.Position.Y &&
     harePlayer.Position.X <= (harePlayer.Position.X + 52) &&
     tl.Position.Y <= (harePlayer.Position.Y + 50)))
Run Code Online (Sandbox Code Playgroud)

谁能告诉我修复是什么?谢谢.:)

c# boolean operand

-5
推荐指数
1
解决办法
478
查看次数

Twitter api显示身份验证错误

我正在整合Twitter与Android它显示流动的错误请帮助解决错误

{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]} 

twitter android

-7
推荐指数
1
解决办法
880
查看次数

如何从整数中删除最小值数字并返回其余部分而不使用字符串

如何从一个整数中删除最小值数字并返回其余部分而不使用string.Like如果我们有数字4412,然后重新启动1并返回442.我做了编码提取最小数字但不知道如何组合休息他们

public class RemoveSmallestDigit {

    static int testcase1 = 4487;
    static int testcase2 = 1111;

    public static void main(String args[]){
        RemoveSmallestDigit testInstance = new RemoveSmallestDigit();
        int result = testInstance.removeSmallestDigit(testcase1);
        System.out.println(result);
    }

    //write your code here
    public int removeSmallestDigit(int num){
        int small=9;
        int digit=0;
        while(num!=0){
            digit=num%10;
            num=num/10;
            if(digit<=small){
                small=digit;
            }
        }
        System.out.println(small);
        return small;

    }
}
Run Code Online (Sandbox Code Playgroud)

java

-11
推荐指数
1
解决办法
244
查看次数