如何使用(int)/ intval将字符串转换为整数? [英] How to convert string to integer with (int)/intval?

查看:73
本文介绍了如何使用(int)/ intval将字符串转换为整数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


gush,令人沮丧。我不是专业人士;但我非常了解PHP以了解它是如何工作的。通过(int)$ value或intval($ value)从字符串到整数的简单转换应该很简单。但它在我的情况下不起作用。


我有一个字符串:

Hi there,

gush, frustrating. I am not a pro; but I know PHP well enough to understand how it works. And a simple conversion from string to integer via (int)$value or intval($value) should be straightforward. But it''s not working in my case.

I have a string:

展开 | 选择 | 换行 | 行号

推荐答案

value或intval(
value or intval(


value)应该很简单。但它在我的情况下不起作用。


我有一个字符串:
value) should be straightforward. But it''s not working in my case.

I have a string:
展开 | 选择 | 换行 | 行号


取决于您的RegEx,
depending on your RegEx,


这篇关于如何使用(int)/ intval将字符串转换为整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆