首页 \ 问答 \ 如何从Array中获取非空数组(How to fetch non-empty Array from an Array)

如何从Array中获取非空数组(How to fetch non-empty Array from an Array)

Array包含一些非空数组。 我需要获取相应的非空数组并打印数据。 例如:数组2的变量为importTroubles-> troubleMessage我该如何打印?

Array
(
 [0] => stdClass Object
    (
    )

[1] => stdClass Object
    (
    )

[2] => stdClass Object
    (
        [return] => stdClass Object
            (
                [failureMessage] => 
                [importTroubles] => stdClass Object
                    (
                        [kind] => ParseError
                        [rowNumber] => 1
                        [troubleMessage] => Field "number1" has invalid value: "+16046799329". Invalid phone number //need to print this..
                    )

                [keyFields] => number1
                [uploadDuplicatesCount] => 0
                [uploadErrorsCount] => 1
                [warningsCount] => stdClass Object
                    (
                    )

                [callNowQueued] => 0
                [crmRecordsInserted] => 0
                [crmRecordsUpdated] => 2
                [listName] => new camp from CRM1-TargetList-CRM
                [listRecordsDeleted] => 0
                [listRecordsInserted] => 2
            )

    )

[3] => stdClass Object
    (
    )

[4] => stdClass Object
    (
    )

我正在尝试这种方法:

foreach($result as $object) {
foreach ($object as $items) {

    if($items !== '')
    {
        foreach ($items as $item) {
            echo "ERROR".$item->troubleMessage;
        }
    }

}
}

谢谢你的努力


The Array contains some non-empty arrays . i need to fetch respective non-empty array and print the data . eg: array 2 has variable as importTroubles->troubleMessage how can i print that?

Array
(
 [0] => stdClass Object
    (
    )

[1] => stdClass Object
    (
    )

[2] => stdClass Object
    (
        [return] => stdClass Object
            (
                [failureMessage] => 
                [importTroubles] => stdClass Object
                    (
                        [kind] => ParseError
                        [rowNumber] => 1
                        [troubleMessage] => Field "number1" has invalid value: "+16046799329". Invalid phone number //need to print this..
                    )

                [keyFields] => number1
                [uploadDuplicatesCount] => 0
                [uploadErrorsCount] => 1
                [warningsCount] => stdClass Object
                    (
                    )

                [callNowQueued] => 0
                [crmRecordsInserted] => 0
                [crmRecordsUpdated] => 2
                [listName] => new camp from CRM1-TargetList-CRM
                [listRecordsDeleted] => 0
                [listRecordsInserted] => 2
            )

    )

[3] => stdClass Object
    (
    )

[4] => stdClass Object
    (
    )

)

im trying with this method :

foreach($result as $object) {
foreach ($object as $items) {

    if($items !== '')
    {
        foreach ($items as $item) {
            echo "ERROR".$item->troubleMessage;
        }
    }

}
}

Thanks for your efforts


原文:https://stackoverflow.com/questions/46450062
更新时间:2024-02-22 07:02

最满意答案

第一个EDF094632432432D9C585014E22E7073不是有效的蓝牙GATT UUID。

关于您最初的问题,2017年3月无法扫描BLE广告数据包(例如信标)。 在某些时候,应该执行Web蓝牙扫描: https//webbluetoothcg.github.io/web-bluetooth/scanning


First EDF094632432432D9C585014E22E7073 is not a valid Bluetooth GATT UUID.

Regarding your initial question, there is no way as of March 2017 to scan BLE advertisement packets (eg. beacon). At some point, Web Bluetooth scanning should be implemented: https://webbluetoothcg.github.io/web-bluetooth/scanning

相关问答

更多
  • 你为什么那么想: private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb"); 是UUID(通用唯一ID)? 您现在拥有使用此代码的所有设备具有相同的 UUID。 你需要一个更好的UUID .... 看看这个问题(以及它的答案): 如何在应用程序中获取我的Android手机的UUID? Why would you think that: private static fin ...
  • 我用这个: public class BLEUtils { public static final long BT_UUID_LOWER_BITS = 0x800000805F9B34FBl; public static final long BT_UUID_UPPER_BITS = 0x1000l; public static final long BT_CCCD_SHORT_UUID = 0x2902l; public static final UUID BT_CCCD ...
  • 外设使用一个随机可解析的地址,至少每15分钟更改一次,此时外设看起来是新的。 要改变这种行为,你需要与外设配对,然后你会看到UUID,它会持久。 The peripheral uses a random resolvable address that changes at least every 15 minutes, at which point the peripheral will appear to be new. To change this behavior you need to pair w ...
  • 蓝牙通信是与服务的通信,所以当你想连接到设备时,你试图连接到服务,而uuid是我们连接到服务的号码,好的,我想这个uuid(这个服务)。 bluetooth communication is communication with service, so when you wanna connect to device you are attempting to connect to service,and uuid is number with which we connect to service, li ...
  • 试试这个例子, http://luugiathuy.com/2011/02/android-java-bluetooth/ 。 我也遇到了与UUID相关的问题,在本例中,将UUID转换为开箱即用的00001101-0000-1000-8000-00805F9B34FB 。 请看这个链接: http : //www.avetana-gmbh.de/avetana-gmbh/produkte/doc/javax/bluetooth/UUID.html Try this example, http://luugi ...
  • 第一个EDF094632432432D9C585014E22E7073不是有效的蓝牙GATT UUID。 关于您最初的问题,2017年3月无法扫描BLE广告数据包(例如信标)。 在某些时候,应该执行Web蓝牙扫描: https : //webbluetoothcg.github.io/web-bluetooth/scanning First EDF094632432432D9C585014E22E7073 is not a valid Bluetooth GATT UUID. Regarding your ...
  • 在服务器端,当您调用相应的listen函数时,将其传递给UUID。 在客户端,调用startDiscovery()并侦听已发现的设备。 对于找到的每个设备,获取BluetoothDevice对象并调用getUUIDs()以获取远程设备实现的UUID。 检查与UUID.equals()的匹配项。 On the server side, when you call the appropriate listen function, pass it the UUID. On the client side, cal ...
  • 检查了这些文档并设法看到类似的代码段: chrome.bluetoothSocket.onRecieve.addListener(function(receiveInfo) { if (receiveInfo.socketId != socketId) return; // receiveInfo.data is an ArrayBuffer. }); 如果仔细观察,似乎在onRecieve部分的样本中有一个拼写错误。 它应该是onReceive 。 您可以在此处查看正确的示例。 我在E之 ...
  • 当您找到蓝牙的任何外围设备时,您将在下面的委托方法中获得详细信息 - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {
  • Laalto从蓝牙规格/堆栈POV中找到了答案,但您的问题意味着您正在寻找一个独立的蓝牙设备 - 而不仅仅是扫描周围设备的笔记本电脑应用程序。 我只能代表我为制造商工作的BT芯片(Cambridge Silicon Radio - CSR),但我们的芯片可以开箱即用。 我们的芯片有一个板载虚拟机沙箱,可以访问固件功能和芯片的蓝牙堆栈。 您可以轻松编写C代码应用程序,在芯片上的虚拟机沙箱中运行,定期扫描可发现的设备,获取其ID然后在通过USB或串行连接时下载它们,或者在设备连接时通过BT进行下载听众直接。 w ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)