PHP Programs

TheFestFever.com

Our aim is to connect students from campuses all over Delhi by making them aware of all Technical, Cultural, Management fests, workshops, Seminars organized by every college in Delhi.

Join Us Now

Program 21: Write a PHP program to convert the value of a PHP variable to string.

var_string.php

<!DOCTYPE html>
<html>
<head>
	<title>PHP Progarms TutorialDuniya.com</title>
</head>
<body>
	<?php
		$num = 25;       	//$num is an integer 
		$str1 = (string)$num;    //$str1 is a string now

		// Check whether $num and $str1 are equal are not 
		if ($num === $str1)
		{
			echo "They are the same"."\n";
		} 
		else
		{
			echo "They are not same"."\n";
		}
	?>
</body>
</html>



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.