草庐IT

push-notification

全部标签

php - 您可以使用 array_push() 将一个数组插入另一个数组吗?

这是将一个数组压入另一个数组的正确方法吗?另外,是否所有数组推送都需要2个参数?$edge=array("nodeTo"=>"$to");array_push($node["adjacencies"],$edge); 最佳答案 documentation对此很清楚:Note:Ifyouusearray_push()toaddoneelementtothearrayit'sbettertouse$array[]=becauseinthatwaythereisnooverheadofcallingafunction函数定义列出了两个参数

php - 如何使用 Laravel Eloquent push() 函数?

我正在努力使用laravelpush()函数我的代码在这里:$company=newCompany(array('name'=>'Company1'));$company->persons[]=newPerson(array('name'=>'Company1Person1','mobile'=>12345));$company->persons[]=newPerson(array('name'=>'Company1Person2','mobile'=>112233));$company->push();存储时:公司存储很好,但是对于公司人员,它将company_id存储为0Larav

php - 使用 PHP 执行 cURL 发送推送通知

我正在尝试发送cURL命令来发送推送通知。我是cURL的新手,似乎无法运行命令。这是cURL命令行:curl--header"Authorization:key=AAAAVD27CWY:APA91bE7YdKYiqTmQhErf0E3gm8lbgNt2KP5-xPQf83V7m8eKsa0ljktOLiGyzzrP0uxVNBHC6cyuJAPejkTyNl1DnoxcajesLvGXIzq3YR1l-wiFvoivRmIUkDvThTsKCJkZMomhEPp"--headerContent-Type:"application/json"https://android.googlea

php - aws.push 到多个环境

我有两个不同的环境运行同一个git存储库。看起来在用于git和elasticbeanstalk的AWS控制台工具中,我一次只能连接一个环境,是否可以同时推送到我的两个环境? 最佳答案 最新版本允许您将不同的分支映射到不同的存储库,请参阅Announcement:DeployGitBranchestoMultipleElasticBeanstalkEnvironments:Startingtoday,youcanuseebandGittodeploybranchestomultipleElasticBeanstalkenvironme

php - 如何在不使用 cURL 的情况下在 php 中发送 gcm 消息?

我正在使用以下代码向gcm服务器发出HTTPPOST请求。该代码始终返回“未经授权的错误401”。我读到它与标题有关,但无法弄清楚出了什么问题。谁能告诉我怎么了?还有其他方法可以发送gcm消息吗?任何帮助将不胜感激。$api_key="AIzaSyBhuPSdHmq6-************_qxSJr8d0";$message=array("msg_url"=>$msg_url,"msg_title"=>$msg_title);$url='https://android.googleapis.com/gcm/send';$fields=array('registration_ids

php - array_push 在 foreach 循环中不起作用

print_r($members)如下结果Array([myname]=>Array([userid]=>52[age]=>46)Array([hisname]=>Array([userid]=>22[age]=>47)Array([yourname]=>Array([userid]=>47[age]=>85)array_push()推送在foreach循环中不起作用foreach($membersas$key=>$item){//print"".$key."";array_push($members,'$key');}使用array_push()后的代码期待这样的结果Array([m

php - Apple Push Notification 在我的 godaddy 共享服务器上不起作用,连接失败 111 连接被拒绝 php 推送通知错误

我收到一个错误,例如无法连接111连接拒绝使用APNS的php推送通知。它在本地服务器上运行良好,但在GoDaddy共享服务器上运行不正常。请查找我的Php代码。$path_pem_file="http://dummy.com/uploads/app/1.pem";//thisisthepassphraseyoudefinedwhencreatingthekey$passphrase='';//thisiswhereyoucancustomizeyournotification$payload='{"aps":{"alert":"message","sound":"default"}}

php - 苹果官网推送: Signature verification of push package failed, 但是苹果证书没问题

我正在尝试使用Codeigniter向Safari实现Web推送通知,我正在关注AppleGuide我创建了一个库来创建基于此connorlacombe的推送包github项目。这是我的图书馆:initialize($config);}log_message("debug","AppleClassInitialized");}publicfunctioninitialize($config=array()){if(empty($config["certificate_path"])||empty($config["certificate_password"])||empty($conf

PHP 苹果增强通知

我一直在使用thisexcellentblogpost尝试让ApplePushNotifications从我的服务器运行。连接似乎建立良好,我可以写信给它。但是,没有通知到达。为了尝试调试它,我想构建一个“增强通知”,这将使APNS服务器在断开连接之前返回一个错误代码。但是,我不确定如何使用PHP构建要发送到服务器的数据。根据教程帖子,目前我使用的是普通通知:$apnsMessage=chr(0).chr(0).chr(32).pack('H*',str_replace('','',$deviceToken)).chr(0).chr(strlen($payload)).$payload

PHP 数组。使用 array_push() 将 "$key"=> "$value"对插入数组;

为什么这行不通?$slidetotal=1;$slideids=array();while($rowcs=mysql_fetch_array($orig_slides_result)){$key=$slidetotal;array_push($slideids[$key],$rowcs['id']);$slidetotal++;}我得到这个错误:[phpBB调试]PHP注意:在文件///*.php第161行:array_push()[function.array-push]:第一个参数应该是一个数组尽管有人评论说您可以在此页面上执行此操作:http://php.net/manual/e