首页 \ 问答 \ 在PHP中,变量赋值何时返回false?(In PHP when would a variable assignment return false?)

在PHP中,变量赋值何时返回false?(In PHP when would a variable assignment return false?)

什么时候PHP变量赋值返回false?

本回答中 ,建议使用以下代码

while (($lastPos = strpos($html, $needle, $lastPos))!== false) {
    $positions[] = $lastPos;
    $lastPos = $lastPos + strlen($needle);
}

... while循环将在作业结束时结束......

$lastPos = strpos($html, $needle, $lastPos)

...返回false。

什么时候这个赋值会返回false?为什么?

谢谢


When would a PHP variable assignment return false?

In this answer the following code is suggested

while (($lastPos = strpos($html, $needle, $lastPos))!== false) {
    $positions[] = $lastPos;
    $lastPos = $lastPos + strlen($needle);
}

... the while loop will end when the assignment...

$lastPos = strpos($html, $needle, $lastPos)

...returns false.

When would this assignment return false and why?

Thanks


原文:https://stackoverflow.com/questions/44574227
更新时间:2023-12-17 17:12

最满意答案

你必须明确地调用同步。 SDK中没有任何内容可以持续检测更改并自动触发同步。


you have to explicitly invoke the sync. there's nothing in the SDK for continuously detecting changes and automatically triggering a sync.

相关问答

更多
  • 查看智能客户端软件工厂中的断开服务代理应用程序块: http://msdn.microsoft.com/en-us/library/cc540752.aspx 它为远程Web服务调用提供了存储转发机制 - 您可以将其与缓存结合起来以实现类似的功能。 Take a look at the Disconnected Service Agent Application Block from the Smart Client Software Factory: http://msdn.microsoft.com/e ...
  • 您可以只复制文件,因为Sync Fx仍然使用COM。 如果您不想单独手动安装Sync Fx,可以使用应用程序安装程序进行引导。 You can just copy the files as Sync Fx still uses COM. If you dont want to manually install the Sync Fx separately, you can bootstrap it with your application installer.
  • 如果您为ChangesSelected或ChangesApplied创建处理程序,那么将有一个数据集包含已选择或应用的实际数据。 if you create a handler for ChangesSelected or ChangesApplied, there'll be a dataset there that contains the actual data that was selected or applied.
  • MongoDB没有开箱即用的同步提供程序,因此您必须自己编写。 假设您可以自己编写,则必须修改Sync Toolkit服务器端组件,以将SqlSyncProvider替换为您的自定义MongoDB提供程序。 我建议你查看Sync Framework Toolkit的许可。 如果我没记错的话,客户端组件是Apache许可证,但服务器端是MSPL。 @Mrinal : I started writting a Microsoft Sync Framework MongoDB Provider but i rea ...
  • 你必须明确地调用同步。 SDK中没有任何内容可以持续检测更改并自动触发同步。 you have to explicitly invoke the sync. there's nothing in the SDK for continuously detecting changes and automatically triggering a sync.
  • 我认为这是一个有效的例外。 即使不使用Sync Framework,也无法在表中插入相同的主键值。 请参阅为分布式环境选择适当的主键,以获取在Sync Framework中选择表的键的准则 I think that is a valid exception. even without using Sync Framework, you cant insert the same Primary Key value in a table. see Selecting an Appropriate Primary ...
  • 你在使用哪个提供商? SqlCeSyncProvider / SqlSyncProvider? 假设它如上: 是。 但是,如果仅定义一个范围,则Sql Ce客户端应用程序同步将在包含同步知识的同一scope_info行上发生争用。 并且他们也会争用表/行被同步。 你会发生冲突。 当第二个客户端同步时,没有记录需要更新,Sync Framework将引发冲突(很可能是ClientUpdateServerDelete) 如果您使用上面的提供程序,则没有父子关系。 上述提供商以点对点的方式工作。 你甚至可以将Sq ...
  • 您是否允许更改移动设备和服务器? 如果是这样,如果移动设备上的用户A和服务器上的用户B更改了相同的数据记录,您将如何处理冲突? 同步框架和WCF之间的最大区别在于,构建同步框架是为了检测此类冲突并提供处理它们的例程,而WCF则不然。 话虽如此,你说“在服务器端我实际上需要调用.net dll来进行更新”。 如果您要说的是这必须是您的公司已经或正在开发的特定DLL,这似乎排除允许同步框架直接更新SQL Server。 使用同步框架时,它直接与服务器和移动设备上的数据库通信。 Will you be allow ...
  • 我假设你正在使用Sync Framework Toolkit。 您应该能够从中创建多个模板和多个范围。 am assuming you're using the Sync Framework Toolkit. you should be able to create multiple templates and multiple scopes from them.
  • 最后我能够自己解决。 在Windows 8.1应用程序中,必须在程序包清单文件中检查选项专用网络(客户端和服务器)。 这就对了。 ! Finally I am able to solve it by myself. In Windows 8.1 application, the option Private Network (Client and server) must be checked in the package manifest file. That is it. !!!

相关文章

更多

最新问答

更多
  • 您如何使用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)