Junior Spellweaver
- Joined
- Sep 1, 2008
- Messages
- 130
- Reaction score
- 0
Hi there.
I'm following a PHP book so I can learn PHP. I've just wrote out the code it's asked me to and I'm getting a UNEXPECTED T_STRING on line 16. As I'm not good a PHP yet, I need you guys in order to help me slove it.
Heres the code.
Thanks for reading,
Edit: Not to be rude or whatever. Could someone explain why this is happening so I can get a better understanding of PHP errors. Thanks Again.
I'm following a PHP book so I can learn PHP. I've just wrote out the code it's asked me to and I'm getting a UNEXPECTED T_STRING on line 16. As I'm not good a PHP yet, I need you guys in order to help me slove it.
Heres the code.
PHP:
<html>
<head>
<title>Listing 4.2 chaning the type of a variable with settype()</title>
</head>
<body>
<?php
$undecided = 3.14;
print settype( $undecided ); // double
print " is $undecided<br>"; // 3.14
settype( $undecided, 'string' );
print gettype( $undecided ); // string
print " is $undecided<br>"; // 3.14
settype( $undecided, 'integer; );
print gettype( $undecided ); // integer
print " is $undecided<br>"; // 3
settype( $undecided, 'double' );
print gettype( $undecided ); // double
print " is $undecided<br>"; // 3.0
settype( $undecided, 'boolean' );
print gettype( $undecided ); // boolean
print " is $undecided<br>"; // 1
?>
</body>
</html>
Thanks for reading,
Edit: Not to be rude or whatever. Could someone explain why this is happening so I can get a better understanding of PHP errors. Thanks Again.