本文介绍了从PHP COM返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在为.NET应用程序编写一个控制面板。使用COM类我能够成功运行方法,但我无法查看返回值。我期待-1到13之间的值。 <?php $ archivals = new COM(' Unreal.ArchivalCtrl',NULL,CP_UTF8)或 die( ' 无法启动Archival Com'); // 打开COM $ archivals-> ManualStart(' localhost',' test',true,false); // 让我们开始在服务器上录制视频 $ status = new Variant(NULL); // 将变量var设置为空 $ status = $ archivals-> GetSourceStatus(' localhost',' test'); // 让我们确保记录,获取状态 $ s = print_r($ status); // 将状态转换为字符串 echo $ s; // 查看状态 ?> 输出为:'variant Object 1' 我尝试过variant_get_type以及var_dump但没有成功。 这是链接到我正在使用的API。 提前感谢您的帮助解决方案 archivals = new COM(' Unreal.ArchivalCtrl',NULL,CP_UTF8)或 die(' 无法启动Archival Com'); // 打开COM archivals- > ManualStart(' localhost',' test',true,false); // 让我们开始在服务器上录制视频 status = new Variant(NULL); // 将变量var设置为空 I am writing a control panel for a .NET application. Using the COM class I am able to run methods successfully, but I am unable to view a return value. I am expecting a value between -1 though 13.<?php$archivals = new COM('Unreal.ArchivalCtrl', NULL, CP_UTF8) or die ('Unable to Launch Archival Com');//Open up COM$archivals->ManualStart('localhost', 'test', true, false);//Lets start recording a video on the server$status = new Variant(NULL);//Set variant var to nothing$status = $archivals->GetSourceStatus('localhost', 'test');//Lets make sure it's recording, get a status$s = print_r($status);//Convert status to stringecho "$s";//View status?>The output is: 'variant Object 1'I have tried variant_get_type as well as var_dump with no success.Here is the link to the API I am working with.Thank you in advance for your help 解决方案 archivals = new COM('Unreal.ArchivalCtrl', NULL, CP_UTF8) or die ('Unable to Launch Archival Com');//Open up COMarchivals->ManualStart('localhost', 'test', true, false);//Lets start recording a video on the serverstatus = new Variant(NULL);//Set variant var to nothing 这篇关于从PHP COM返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 05:25