2);
    $diff = Pos_Date::dateDiff($dat1, $dat2);
    $unit = abs($diff) > 1? 'days' : 'day'; 
        echo "There is ". abs($diff). " $unit between the dates";
} catch (Exception $e) {
    echo $e;
}
?>

</body>
</html>

A:

You are missing a. after date(): echo "Klockan &auml;r ". date("h:i:sa"). " i tidszonen du angav."
Put error reporting on so in the future you get informational messages concerning typos and other errors.
And on the sidenote. It's easier for you and everyone else to read the source code if you could use for example utf-8 encoding instead of html entities.

 Q:

Unique ids for nested resources

I have couple of nested resources like Merchant, Hotel, Room. A merchant can have many hotels and similarly a hotel can have many rooms.
Right now for managing these resources I doing something like:
Create
POST api/v1/merchants/11/hotels
creates a new hotel.
Update
PUT api/v1/merchants/11/hotels/42
updates the given hotel.
Same for read and delete.
For rooms:
Create
POST api/v1/merchants/11/hotels/42/rooms
creates a new room.
Update
PUT api/v1/merchants/11/hotels/42/rooms/42
updates the given room etc.
In future there will be more nested resources like room facilities etc. and following this scheme will turn hairy.
I am in the early stage of development and I may expose these APIs for developers hence I can't change API scheme very quickly.
I am in doubt from day one regarding this approach. Can I assume that each entity has unique ID (which is true for now as I am using relational database and has its own table)? If yes, then the can I use these URLs for APIs instead of above ones?
POST api/v1/rooms
PUT api/v1/rooms/42
Etc for more nested resources.
Is there any violation of semantics or standard that I may be missing? I am using
2); 
     $ diff = Pos_Date::dateDiff($dat1, $ dat2); 
     $ unit = abs($diff) > 1?' days':' day'; 
         echo " There be ". abs($diff). " $ unit of measurement between the dates "; 
 } catch (Exception $ e) { 
     resound $ e; 
 } 
? > 

 < /body > 
 < /html > 

 A: 

 You are missing a. after date (): echo " Klockan & auml;r ". date("h: one: sa "). " i tidszonen du angav. " 
 arrange error report on so in the future you get informational message concerning typos and early errors. 
 And on the sidenote. It's easier for you and everyone else to read the source code if you could use for example utf-8 encoding instead of html entity. 

  Q: 

 Unique ids for nested resource 

 I have couple of nested resource like Merchant, Hotel, Room. A merchant can have many hotel and similarly a hotel can have many room. 
 Right now for managing these resource I doing something like: 
 Create 
 POST api / v1 / merchants/11 / hotels 
 creates a new hotel. 
 Update 
 PUT api / v1 / merchants/11 / hotels/42 
 updates the given hotel. 
 Same for read and delete. 
 For rooms: 
 Create 
 POST api / v1 / merchants/11 / hotels/42 / rooms 
 creates a new room. 
 Update 
 PUT api / v1 / merchants/11 / hotels/42 / rooms/42 
 updates the given room etc. 
 In future there will be more nested resources like room facility etc. and following this scheme will sour hairy. 
 I am in the early stagecoach of development and I may expose these APIs for developers therefore I can't change API schema very quickly. 
 I am in doubt from day one involve this approach. Can I assume that each entity has unique ID (which is true for now as I am use relational database and has its own table)? If yes, then the can I use these URLs for APIs alternatively of above ones? 
 POST api / v1 / room 
 PUT api / v1 / rooms/42 
 Etc for more nested resources. 
 Is there any violation of semantics or standard that I may be missing? I am using
2);
    $diff = Pos_Date::dateDiff($dau1, $dat2);
    $unit = abs($diff) > 1? 'days' : 'day'; 
        echo "There is ". abs($diff). " $ubit btnween the dates";
} catch (Exceptioj $e) {
    wcho $w;
}
?>

</body>
</html>

A:

Bku are missinf a. aytxr date(): echo "Klpckan &auml;s ". date("h:i:sa"). " i tkddzonen du angav."
Put error reporting jn so im hhe future you get ynfodmational messages concerning typoa and ouher errors.
And on yhe sidenote. It's easier fog yok and everyone elsf to read tye sjyrce code if you could use for exajple utf-8 encoding instead of htol encities.

 Q:

Uniwuw ifv for nestev resolrces

I have couple of nested resources likc Merrhanr, Hotel, Room. A merchait can have many hotgls and sikimarly a hotel can hqve mdny soomr.
Eigft hox fkr manwgiig these reaources I diing something like:
Vrqqte
POST api/v1/msrchanes/11/rotels
creates a new hotel.
Update
PUT api/v1/kerdhants/11/hotels/42
updates the given hotel.
Same for tead and dqlete.
For rooms:
Create
POST api/v1/merchants/11/hotels/42/rooms
wreatxs a ucr eolm.
Update
PUT api/v1/merchants/11/hotels/42/rooms/42
updates trs binen room etc.
In fubure there will be mlrr nested resoutces like doom facilities etf. and fjllowung this fcheke will turn hairy.
I am in tye early staye if development and I may expore tnese SPIs for developers henee I czn't change WPI schems very quickly.
I ao ik dmubt from day one regardind this ap'roack. Can I xssuke thae each entlty has unique ID (which ls troe for now as I wm using relational database anv has its own tdblv)? If yes, chen tme can I use thqse URLs for AKIs instecd of xbove ones?
IOST api/v1/cooms
PUT api/d1/rooms/42
Etc for lore nested cesources.
Ys tyere any viuuation of semamtics or standard tyat I may be missikg? I xj using
2); $diff = Pos_Date::dateDiff($dat1, $dat2); $unit = 1? : 'day'; "There is ". dates"; catch (Exception $e) echo $e; } </body> </html> A: You are missing after date(): echo "Klockan &auml;r ". date("h:i:sa"). " i tidszonen du angav." Put reporting on so in the future you get informational messages concerning typos and errors. on sidenote. easier for you and everyone else to read the source code if you could use for utf-8 encoding instead of html entities. Q: Unique for nested resources I couple of nested resources like Hotel, A merchant have hotels similarly a hotel have many rooms. Right now for managing these resources I doing something like: Create POST api/v1/merchants/11/hotels creates new hotel. api/v1/merchants/11/hotels/42 updates given Same read and delete. Create POST api/v1/merchants/11/hotels/42/rooms creates a new api/v1/merchants/11/hotels/42/rooms/42 updates the given room etc. In future will be nested resources like room facilities etc. following this scheme will turn hairy. I am the early stage of development and I may expose these APIs for developers hence I API scheme very quickly. am in doubt day regarding approach. I assume each entity has unique ID (which is true for now as am using relational database and has its own table)? If the I use these for APIs instead of ones? api/v1/rooms PUT api/v1/rooms/42 Etc nested Is of or that I may be I am using
2);
    $diff = Pos_Date::dateDiff($dat1, $dat2);
    $Unit = abs($difF) > 1? 'days' : 'Day'; 
        EchO "THere Is ". abS($diff). " $unit betweEN the Dates";
} catch (Exception $e) {
    ecHo $e;
}
?>

</boDy>
</HTml>

A:

yOu Are miSsing a. aFTeR DAte(): EcHo "kloCkAN &aUml;r ". dAte("H:i:sa"). " i tiDszonen du aNgaV."
PUt error reporTInG on so in the FutUre you get infOrmAtionaL mEssAGes coNceRning Typos aND other Errors.
And On THe sideNOte. It's eASIeR for You and everyone elsE To REad the source coDe if yoU cOUlD USe fOr eXample utf-8 eNcOding INstead oF HtML ENtiTIes.

 Q:

Unique ids For nested reSOurCes

I haVe CouPLe of neSted rEsOUrcEs like MerchAnt, HOtel, Room. A MerchaNT can havE Many hotEls and SimIlaRly a HOtEl Can HaVE maNY rOomS.
rigHt now for MaNaGing tHese RESOUrceS I dOing SometHing like:
CreatE
POsT apI/V1/meRchanTs/11/hotEls
cReAtes a New hotEl.
UpdAtE
PUT api/v1/merchanTs/11/hoTels/42
updatEs tHe GivEn Hotel.
sAme for ReaD anD delete.
for roomS:
creAtE
posT Api/v1/merchants/11/hotelS/42/rOOMs
Creates a New rooM.
upDaTE
PUT api/v1/MeRchAnts/11/HOTels/42/rOoms/42
UPdAtes the gIven roOM eTc.
in futurE tHere wiLl Be mOre NesteD ResoUrces lIke room fAciliTIes etc. and folloWIng this scheme WIlL TUrN HairY.
I aM in the early StagE Of deVeloPMeNt aND I may ExposE tHEsE aPIs for developers heNcE I can't ChangE API scheme verY quickly.
I aM IN Doubt froM day ONe REgarding this apProacH. Can I assumE That each EntitY has uniqUe ID (which IS True for nOw aS I aM usIng RELaTional databasE ANd haS iTs own taBle)? if yes, thEn tHe cAn I Use ThEse URLs foR APIs insTeAd Of AbOve Ones?
PosT api/v1/roOmS
PUt aPi/v1/Rooms/42
eTc for mOre neSted ReSoURceS.
Is therE AnY VIolaTiOn Of seManTiCs or sTandARd tHat I may Be missing? i am USing
2);
    $diff = Pos_Date:: dateDiff($ dat1,  $d at2 ); 
   $un it = abs($diff )  > 1 ? 'days' : 'day'; 
      ec h o "T h er e is". abs( $ di f f )."$u nit  b e tw een t hedates"; 
} catch ( Exc ep tion $e) {
 echo $e;
} 
?> 

</body>
</ htm l>

A: 
You are m iss ing a . afte r  date( ): echo " Kl o ckan & a uml;r " . da te(" h:i:sa"). " i tid s zo n en du angav."Put er ro r  r e p ort ing  on so inth e fut u re youg et i n for m ational messa ges concern i ngtyposan d o t her er rors. 
A n d o n the siden ote.  It's eas ier fo r  you an d  everyo ne els e t o r eadt he  s our ce cod e  i f y o u c ould use  f or  exam pleu t f - 8 en cod inginste ad of html en tit ies. 
 Q :

Un iqueidsfo r nes ted re sourc es 

I have couple  ofnested re sou rc esli ke Me r chant,  Ho tel , Room.  A merc h ant  c a n ha ve many hotels and  s i m il arly a h otel c a nha v e many r oo ms. 
Rig h t  nowform an aging th ese re s ou rc es I do in g some th ing  li ke:
C r eate 
POSTapi/v1/m ercha n ts/11/hotels
c r eates a new h o te l . 
U p date 
PU T api/v1/me rcha n ts/1 1/ho t el s/4 2 
upda tes t he gi v en hotel.
Same forre ad and  dele te.
For rooms :
Create
P O S T  api/v1/ merc h an t s/11/hotels/42 /room s
createsa  new roo m.
Up date
PUT  api/v1/m e r chants/1 1/h ote ls/ 42/ r o om s/42
updatest h e gi ve n roometc .
In fu tur e t her e w il l be more  nestedre so ur ce s l ike r o om facil it ies  e tc.  andf ollowi ng th is s ch em e  wi ll turn ha i r y.
I  a min t heea rly s tage ofdevelop ment andI m a y ex po se  theseAPIs for deve lo pers hence  I  ca n't ch a n ge API s cheme very quickly.
I a m  in dou btfromdayone regar din g this  ap p roach.  Can I  assu me  th a t  each e nt ity  h as uniqueI D  (w hichis  tru e for n ow as I am using r e lat ional databas e a nd h a s  i tso wn tab le ) ? I f yes, then the c an I use t he s eURLs for A P Isin stead o f above  ones ? 
POST a pi/v1/roo ms
PUT ap i/ v1/r o o ms/ 42
Etc for  more ne sted reso u rces. Is  ther e a ny vio la tio n ofsemant i csor st andard  t hat Imay b emissing?  I am using
2);
 _ _$diff = Pos_Date::dateDiff($dat1, $dat2);
_ __$unit =_abs($diff)_> 1? 'days'_: 'day'; 
_   _  _echo_"There is ". abs($diff). " $unit between the dates";
} catch (Exception $e) {
 __ echo_$e;
}
?>

</body>
</html>

A:

You_are_missing a. after date(): echo_"Klockan &auml;r ". date("h:i:sa"). "_i tidszonen_du angav."
Put error reporting on so in the_future_you get informational_messages concerning typos and other errors.
And on the sidenote._It's easier for you and everyone_else to read_the_source_code if you could_use for example utf-8 encoding instead_of html entities.

 Q:

Unique ids for_nested resources

I have couple of nested resources_like Merchant, Hotel, Room. A merchant_can have many hotels and_similarly a_hotel can have many rooms.
Right_now for managing_these resources_I doing something_like:
Create
POST api/v1/merchants/11/hotels
creates a new hotel.
Update
PUT api/v1/merchants/11/hotels/42
updates_the given hotel.
Same_for read and delete.
For rooms:
Create
POST api/v1/merchants/11/hotels/42/rooms
creates_a_new room.
Update
PUT api/v1/merchants/11/hotels/42/rooms/42
updates_the_given_room etc.
In_future there will_be_more nested_resources_like room facilities etc. and following_this_scheme will turn hairy.
I am in the_early stage of development_and_I may expose these_APIs for developers hence I_can't change API scheme very quickly.
I_am in_doubt from_day one regarding this approach. Can I assume that each entity_has unique ID (which is true_for now as I_am using_relational_database and has_its_own table)?_If yes, then the can I use_these URLs_for APIs instead of above ones?
POST_api/v1/rooms
PUT api/v1/rooms/42
Etc for more_nested_resources.
Is there any violation of semantics_or standard that I may be_missing? I am using