How to force transcoding in php
This article mainly introduces how to force php transcoding, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Php forced transcoding methods: 1, through "(int) $num1;" transcoding; 2, through "intval ($str);" way of transcoding; 3, through "settype ($num4," int ");" way of transcoding.
This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.
How does php force transcoding?
There are three ways to cast php data type conversions:
(int), (integer): convert to plastic surgery
(float), (double), (real): convert to floating point
(string): convert to string
(bool), (boolean): convert to Boolean type
(array): converting to an array
(object): converting to object
The first conversion method: (int) (bool) (float) (string) (array) (object)
The second conversion method: intval () floatval () strval ()
The third conversion method: settype ()
Thank you for reading this article carefully. I hope the article "how to forcibly transcode php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!