<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[we developers forum - Easy to make mistake]]></title>
	<link rel="self" href="http://forum.wedevs.com/feed/atom/topic/16/"/>
	<updated>2009-01-04T15:36:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.wedevs.com/topic/16/easy-to-make-mistake/</id>
		<entry>
			<title type="html"><![CDATA[Re: Easy to make mistake]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/post/58/#p58"/>
			<content type="html"><![CDATA[thanks (y)]]></content>
			<author>
				<name><![CDATA[Tareq]]></name>
				<uri>http://forum.wedevs.com/user/2/</uri>
			</author>
			<updated>2009-01-04T15:36:43Z</updated>
			<id>http://forum.wedevs.com/post/58/#p58</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Easy to make mistake]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/post/54/#p54"/>
			<content type="html"><![CDATA[hellow…I am trying to post a very simple Example of php variabe assigning..Its easy to make mistake when we assign values.Run the php code:

[code]
<?php

$a=0;

$b;

if ($a==$b) print(”values are same<br>”);

else print(”Variables are different<br>”);

?>
[/code]



output: values are same.

It means the value of $b is 0.

yaa….thats right.when we declare a php variabe Its initial value is 0 in number format.In strig format it is an empty string…its different in C++.

Just try to edit the code like folowing:

[code]
<?php

$a;

$b;

if ($a==$b) print(”values are same<br>”);

else print(”Variables are different<br>”);

?>
[/code]

output is same coz both of these variables values are empty string or NULL..

we can print the value of $b.

printf(”%f”,$b);   //result is 0.0000…//

so be aware of using these types of variable assignment……..I think It will help you…..:)]]></content>
			<author>
				<name><![CDATA[galib]]></name>
				<email><![CDATA[galib_setu@yahoo.com]]></email>
				<uri>http://forum.wedevs.com/user/7/</uri>
			</author>
			<updated>2009-01-04T13:05:42Z</updated>
			<id>http://forum.wedevs.com/post/54/#p54</id>
		</entry>
</feed>
