whats wrong with this? (php)
2 posters
Page 1 of 1
whats wrong with this? (php)
whats wrong with this php? im trying to learn php and im not sure what im doing wrong. im using this site as my sandbox paste and copy the code in to see my error please.
site: sandbox.onlinephpfunctions.com/
the end answer should be 6. and the result sohuld look like
12
6
EDIT: fixed forgot a semi-colon. Solved.
site: sandbox.onlinephpfunctions.com/
- Code:
<?php
static $g;
$m = 6;
$o = 4;
$n = 2
Function money() {
global $g, $m, $o, $n;
$g=$m * $o / $n;
}
function dividemoney() {
global $g, $n;
$g=$g / $n;
}
money();
echo $g;
dividemoney();
echo $g;
?>
the end answer should be 6. and the result sohuld look like
12
6
EDIT: fixed forgot a semi-colon. Solved.
Last edited by Metorrite on February 18th 2013, 10:55 pm; edited 1 time in total
Re: whats wrong with this? (php)
Hi,
I tried it and I believe that this is the error,
I tried it and I believe that this is the error,
<br />
<b>Parse error</b>: syntax error, unexpected '<' in <b>[...][...]</b> on line <b>2</b><br />
Sir Chivas™- Helper
- Posts : 6965
Reputation : 457
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||
Similar topics
» whats wrong
» Whats Wrong about my Forum??
» Post layout is messed up I don't know whats wrong, please help.
» whats wrong in the admin cp?
» Whats wrong with my forum??
» Whats Wrong about my Forum??
» Post layout is messed up I don't know whats wrong, please help.
» whats wrong in the admin cp?
» Whats wrong with my forum??
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum