当前位置: 动力学知识库 > 问答 > 编程问答 >

php - taking out only arithmatic operater in variable

问题描述:

value is -1

i want to take out - sign in a variable how can i do this

网友答案:

If you want to store the "-" (minus) sign in a separate variable, you need to use the substr() function.

<?php
    echo substr('-1', 0, 1); // will result in "-"
?>
网友答案:

These sql useful to you.

select replace(column_name,'-','') from table_name

Eg:- select replace(-1,'-','')

Thank you.

分享给朋友:
您可能感兴趣的文章:
随机阅读: