ich habe eine Kleine Test erhalten die ich lösen muß. Die sind bestimmt für euch sehr leicht zu lösen. Da ich aber nicht sosehr mit PHP zutun habe fallen die mir schon schwer. Würdet ihr mir da bissli Hilfe leisten und erklären wieso und weshalb so ist ?
Einige von diesen Fragen :
1.There’s error in this line:
$$fp = @@fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
What is the correct code?
a) $fp = @@fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
b) $$fp = @fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
c) $$fp = fsockopen($host, 80, $errno, $errstr, $this->$CONNECT_TIMEOUT);
2. Following code doesn’t work in PHP4. Fix the error please.
<?php
class CAcApp {
var $todays_date = date("Y-m-d");
var $name = "John";
var $owner = 'Fred ' . 'Jones';
function CAcApp() {
}
function SomeOutput() {
echo "I am CAcApp class and today is ".$todays_date.". My name is $name and my owner is $owner";
}
}
?>
3 The variable $SUMME contains the value of an input field passed as POST variable and it’s value is “2048,56”. It is verified against the German regional settings. What transformation of $SUMME should be done to save its value into English mySQL DB table without losing the decimal part?
a) $SUMME = strtr($SUMME,”,”,”.”);
b) $SUMME = sprintf(“%10.2f”, $SUMME);
c) $SUMME = strtr(sprintf(“%10.2f”, $_SUMME),”.”,”,”);
Einige von diesen Fragen :
1.There’s error in this line:
$$fp = @@fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
What is the correct code?
a) $fp = @@fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
b) $$fp = @fsockopen($host, 80, $errno, $errstr, $this->CONNECT_TIMEOUT);
c) $$fp = fsockopen($host, 80, $errno, $errstr, $this->$CONNECT_TIMEOUT);
2. Following code doesn’t work in PHP4. Fix the error please.
<?php
class CAcApp {
var $todays_date = date("Y-m-d");
var $name = "John";
var $owner = 'Fred ' . 'Jones';
function CAcApp() {
}
function SomeOutput() {
echo "I am CAcApp class and today is ".$todays_date.". My name is $name and my owner is $owner";
}
}
?>
3 The variable $SUMME contains the value of an input field passed as POST variable and it’s value is “2048,56”. It is verified against the German regional settings. What transformation of $SUMME should be done to save its value into English mySQL DB table without losing the decimal part?
a) $SUMME = strtr($SUMME,”,”,”.”);
b) $SUMME = sprintf(“%10.2f”, $SUMME);
c) $SUMME = strtr(sprintf(“%10.2f”, $_SUMME),”.”,”,”);
Kommentar