Zend PHP 5.3 Certification Exam


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  • Question 2/31

    The following script defines a function called buildUrl(), which is intended to be a crude way of normalizing URLs.

    What line of code must be inserted into buildUrl() to ensure $url1 and code $url2 are both equal to http://phpriot.com/quiz/?

    
    <?php
        function buildUrl($domain$path) {
            // insert line of code here
            return $ret;
        }
    
        $domain1 'http://phpriot.com/';
        $domain2 'http://phpriot.com';
        $path    '/quiz/';
    
        $url1 buildUrl($domain1$path);
        $url2 buildUrl($domain2$path);
    ?>