An odd assignment statement. Can someone explain this assignment to me?


Posted on 16th Feb 2014 07:03 pm by admin

What purpose is served by the bit of code between the two equal signs in the $installurl set? Is this some sneaky way of setting $baseurl? I remember the code seemed to blow up when I took it out.

Code: [Select] $protocol = $_SERVER['HTTPS']==='on' ? 'https://' : 'http://';
$installurl = $protocol.$_SERVER['SERVER_NAME'].$baseurl=implode('/PETE/',array_slice(explode('/PETE/',$_SERVER['SCRIPT_NAME']),0,-1)).'/';

As always, any help greatly appreciated.

No comments posted yet

Your Answer:

Login to answer
282 Like 52 Dislike
Previous forums Next forums
Other forums

Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thoug

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

Serial number of exernal hard disk/Thumbdrive
Hi guys, I am new tio java networking concepts.Please tel me how to get Serial number of exernal

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

Help with explandable category tree
I have the below query:

SELECT l1.id as lev1_id,l2.id as lev2_id,l3.id as lev3_id,l1.categ

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

How to find OS bit version
How can I tell the person browsing my site is running 32, or 64 bit operating system?

Random date selection
i want to select random date with time(hour+minutes+sec) where date is specified(10/22/2009) and tim

Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash