PHP ֧�� 9 ��ԭʼ�������͡�
���ֱ������ͣ�
���ָ������ͣ�
����������������ͣ�
Ϊ��ȷ����������ԣ����ֲỹ������һЩα������
�Լ�α���� $...��
���ܻ������һЩ����"˫���ȣ�double��"���͵IJο���ʵ���� double �� float ����ͬ�ģ�����һЩ��ʷ��ԭ������������ͬʱ���ڡ�
����������ͨ�������ɳ���Ա�趨�ģ�ȷ�е�˵������ PHP ���ݸñ���ʹ�õ�������������ʱ�����ġ�
Note: �����鿴ij�����ʽ��ֵ�����ͣ��� var_dump() ������
���ֻ����õ�һ�����������͵ı�﷽ʽ���ڵ��ԣ��� gettype() ������Ҫ����ij�����ͣ���Ҫ�� gettype()������ is_type ������������һЩ������
<?php
$a_bool = TRUE; // ����ֵ boolean
$a_str = "foo"; // �ַ��� string
$a_str2 = 'foo'; // �ַ��� string
$an_int = 12; // ���� integer
echo gettype($a_bool); // ���: boolean
echo gettype($a_str); // ���: string
// ��������ͣ��ͼ��� 4
if (is_int($an_int)) {
$an_int += 4;
}
// ��� $bool ���ַ������ʹ�ӡ����
// (ɶҲû��ӡ����)
if (is_string($a_bool)) {
echo "String: $a_bool";
}
?>
���Ҫ��һ������ǿ��ת��Ϊij���ͣ����Զ���ʹ��ǿ��ת������ settype() ������
ע����������䵱ʱ���������ض������»���ֳ���ͬ��ֵ��������Ϣ������ת�����б������⣬�����Բο� PHP ���ͱȽϱ�����ͬ������Ƚϵ����ӡ�