小编mai*_*oui的帖子

添加...如果字符串太长PHP

我的MySQL数据库中有一个描述字段,我在两个不同的页面上访问数据库,一个页面显示整个字段,但另一方面,我只想显示前50个字符.如果说明字段中的字符串少于50个字符,那么它将不会显示...,但如果不是,我将在前50个字符后显示....

示例(完整字符串):

Hello, this is the first example, where I am going to have a string that is over 50 characters and is super long, I don't know how long maybe around 1000 characters. Anyway this should be over 50 characters now ...
Run Code Online (Sandbox Code Playgroud)

例2(前50个字符):

Hello, this is the first example, where I am going ...
Run Code Online (Sandbox Code Playgroud)

php string strlen

105
推荐指数
5
解决办法
12万
查看次数

Xcode中Pods.debug.xcconfig的路径不正确?

所以我在CocoaPods的 Xcode项目中使用了Venmo/Synx,它完全搞砸了所有东西.

我能够修复Manifest.lock和Podfile.lock错误,但现在我收到此错误:

无法打开文件"Pods.debug.xcconfig",因为没有此类文件.(/ Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig)

如您所见,路径不正确,因为没有Pods/Pods目录(有一个额外的pod).

我怎样才能解决这个问题?我只添加PODS_ROOT了用户定义的变量,因为它修复了我的Podfile和Manifest.lock文件.

任何帮助将非常感激!


编辑:

添加PODS_ROOT后,我在运行时得到它pod install.

[!] The `Project [Debug]` target overrides the `PODS_ROOT` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
Run Code Online (Sandbox Code Playgroud)

xcconfig cocoapods xcode6.1

46
推荐指数
5
解决办法
4万
查看次数

PHP未定义索引错误$ _FILES?

我是PHP新手,我正在关注YouTube上的教程.我有一切在这个文件中工作,除了文件上传,任何帮助将不胜感激.这是我得到的错误:

*注意:我已多次查找,但找不到与$ _FILES相关的未定义索引错误...

注意:未定义的索引:第95行的/ Applications/xxx中的头像

注意:未定义的索引:第96行的/ Applications/xxx中的头像

注意:未定义索引:第97行/ Applications/xxx中的头像

注意:未定义的索引:第98行的/ Applications/xxx中的头像

对不起,如果这是一个简单的修复......

            <?php $title = "Register";?>
        <?php require ("styles/top.php") ; ?>           
        <?php //de-bugging remove this after script works as desired>
        error_reporting(E_ALL);
         ini_set("display_errors", 1); 
        //end de-bugging//

        $form = "<form action='register.php' method='post'>
        <table cellspacing='5px'>
            <tr>
                <td></td>
                <td><font color='red'>*</font> are required fields.</td>
            </tr>
            <tr>
                <td>First Name:</td>
                <td><input type='text' name='firstname' class='textbox'><font color='red'> *</font></td>
            </tr>
            <tr>
                <td>Last Name:</td>
                <td><input type='text' name='lastname' class='textbox'><font color='red'> *</font></td>
            </tr>
            <tr>
                <td>Username:</td>
                <td><input type='text' name='username' class='textbox'><font color='red'> *</font></td>
            </tr>
            <tr> …
Run Code Online (Sandbox Code Playgroud)

php error-handling upload file undefined

5
推荐指数
3
解决办法
4万
查看次数

多个AND条件MySQL

如何在子句中包含多个AND条件?就像SELECT * FROM database WHERE x=x,y=y AND z=z我试过的那样,它没有用.谢谢.

php mysql

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

PHP类; 注意:未定义的属性错误

在我提出问题之前,我想说我搜索了这个问题,其他答案都没有帮助......

基本上,在我的班级中DemoClass,我有4个函数,所有函数都是"未定义的属性"

我的错误:

注意:未定义的属性:第46行的/home/content/92/10270192/html/class.php中的DemoClass :: $函数

注意:第46行是我做$ demoClass-> function的地方......

我有一个典型的类设置:

class DemoClass {
    public function __construct () {
        // stuff that works and gets called
    }
    public function testFunct () {
        // one that is an "undefined property"
    }
}
Run Code Online (Sandbox Code Playgroud)

我正常访问该类:

$testClass = new DemoClass();
var_dump(testClass->testFunct); // this is what is on line 46
// ^^^ This also gives me NULL, because its undefined (? i guess...)
Run Code Online (Sandbox Code Playgroud)

我之前从未遇到过这个问题,有什么建议吗?谢谢!

php class function undefined

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