草庐IT

invalid-name

全部标签

html - 当它因 'htmlParseEntityRef: no name' 错误而失败时如何加载 HTMLFile()?

我正在尝试从以下位置获取字符串“hinsonlouann”:hinsonlouann当我运行以下命令时:$html="http://gisapps.co.union.nc.us/ws/rest/v2/cm_iw.ashx?gid=12339";$doc=newDOMDocument();$doc->loadHTMLFile($html);$xpath=newDOMXpath($doc);$elements=$xpath->query("*/div[@class='owner-name']");if(!is_null($elements)){foreach($elementsas$ele

php - 未定义的属性:Illuminate\Database\Eloquent\Relations\BelongsTo::$name laravel 5.4

大家好,以下是我的亲戚用户模型publicfunctionloginlogout(){$this->HasMany("App\Models\LoginLogoutLogs");}这是我的LoginLogoutLogs模型publicfunctionusers(){return$this->belongsTo('App\Models\User');}我正在尝试从这样的用户访问名称$loginLogoutLogs=LoginLogoutLogs::all();foreach($loginLogoutLogsas$loginLogoutLog){dd($loginLogoutLog->use

php - 还原 Laravel app.name

我想更改我的Laravel项目的app.name,新名称中有一个空格。由于更改了名称,我得到了PHP错误:PHPFatalerror:UncaughtReflectionException:ClassApp\Console\KerneldoesnotexistinD:\xampp\htdocs\sistemas\selecao-geral\vendor\laravel\framework\src\Illuminate\Container\Container.php:752我现在想恢复名称,但由于上述错误也失败了。我怎样才能改回应用程序名称,我可以手动执行此操作吗?

PHP 对象 : get value of attribute by computed name

如果我在运行时计算名称,如何按名称访问对象的属性?例如。我遍历键并想要获取属性"field_"的每个值。$键。在python中有getattribute(myobject,attrname)。当然,它适用于eval("$val=$myobject->".$myattr.";");但IMO这很丑陋-有更清洁的方法吗? 最佳答案 请记住,PHP的一个非常强大的特性是它的VariableVariables你可以使用$attr='field'.$key;$myobject->$attr;或者更简洁,使用大括号$myobject->{'fie

php - 谷歌服务帐户示例返回 "Error refreshing the OAuth2 token { “error” : “invalid_grant” }"

我的目标是代表我的网络应用程序用户在GoogleFusionTables上进行最简单的查询。为此,我在Google控制台上创建了一个服务帐户。这是代码://Creatingagoogleclient$client=new\Google_Client();//settingtheserviceacountcredentials$serviceAccountName='XXXXX.apps.googleusercontent.com';$scopes=array('https://www.googleapis.com/auth/fusiontables','https://www.goog

PHP "Warning: usort() [function.usort]: Invalid comparison function"排序

我有以下数据作为关联数组array'abc'=>array'label'=>string'abc'(length=3)'weight'=>float3'wsx'=>array'label'=>string'wsx'(length=3)'weight'=>float1'qay'=>array'label'=>string'qay'(length=3)'weight'=>float1'http://test.com'=>array'label'=>string'http://test.com'(length=15)'weight'=>float0'Nasi1'=>array'label'=

php - 将 2 个正则表达式合并为一个时得到 "two named subpatterns have the same name"

我试图将2个具有相同名称的不同正则表达式合并为一个,但得到的错误消息如下:Warning:preg_match():Compilationfailed:twonamedsubpatternshavethesamenameatoffset276...一个正则表达式如下所示:'%[\s\S]*?(?P[\s\S]*?)%'另一个看起来像这样:'%[\s\S]*?(?P[\s\S]*?)%'我可以毫无问题地按以下方式组合它们:'%([\s\S]*?(?P[\s\S]*?)|[\s\S]*?(?P[\s\S]*?))%'但我不喜欢这种方式,因为我使用了2个名字。我想知道是否有更好的方法来解决这

php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

从文件("http://www.otherdomain.com")获取内容时出现以下错误。file()[function.file]:php_network_getaddresses:getaddrinfofailed:Temporaryfailureinnameresolution域服务器是linux。如何解决这个问题? 最佳答案 引用:Ifyou'rehavingproblemswithfopen("url...")butyoucanrun'hosturl'inashellwindowandgetthecorrectlookup

php oci_bind_by_name float

我需要将float绑定(bind)到OCI语句。我在做什么:$price=0.1oci_bind_by_name($resource,'price',$price);在我的Oracle数据库中,“价格”是存储过程的一个参数,它的类型是NUMERIC。执行语句后出现以下错误:Message:oci_execute()[function.oci-execute]:ORA-06502:PL/SQL:numericorvalueerror:charactertonumberconversionerrorORA-06512:atline1如果$price是一个整数,一切正常。在PHP文档中htt

php - 谷歌 PHP API : "invalid response from api server"

我在本地主机上的GoogleAppEngine上运行的应用程序中使用GooglePHPAPIClientv2.0。当我将我的应用程序发布到GoogleAppEngine产品时,我没有收到错误,但它是间歇性的,所以很难知道我是否只是在生产中走运。我的GoogleAPI客户端正在尝试将文件写入我的Google云端硬盘。这段代码几个月来一直运行良好,但今天早上突然停止运行。我检查了GoogleAPI状态,他们没有报告任何中断。当我执行任何API调用时,我得到这个模糊的错误响应:Fatalerror:fopen():InvalidresponsefromAPIserver.in/Users/m