daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <departureDate>200912</departureDate>
  2.    
  3. $year = $flightDates->departureDate->year;
  4.    
  5. // first two
  6. $year = substr($flightDates->departureDate->year, 0, 2);
  7. // last two
  8. $year = substr($flightDates->departureDate->year, -2);
  9.    
  10. <?php
  11. $someDate ='200912';
  12. $dateObj = DateTime::createFromFormat('dmy', $someDate);
  13. echo $dateObj->format('Y');
  14. // prints "2012" .. (see date formats)
  15.    
  16. <?php
  17.  
  18. //$year = '200912';
  19. $year = $flightDates->departureDate->year;
  20.  
  21. echo substr( $year, -2 );
  22.  
  23. ?>
  24.    
  25. <?php
  26.  
  27. //$year = '200912';
  28. $year = $flightDates->departureDate->year;
  29.  
  30. $date = DateTime::createFromFormat( 'dmy', $year );
  31.  
  32. echo date( "y", $date -> getTimestamp() );
  33.  
  34. ?>
  35.    
  36. while ( $var > 100 )
  37. {
  38.     $var = (int) $var / 10;
  39. }
  40.    
  41. $number = '<departureDate>200912</departureDate>' ;
  42. $year = substr(strip_tags($number), 0,2);
  43. var_dump($year);
  44.    
  45. $number = '<departureDate>200912</departureDate>' ;
  46. $year = substr(simplexml_load_string($number),0,2);
  47. var_dump($year);
  48.    
  49. string '20' (length=2)
  50.    
  51. byte[] array= Integer.toString(x).get.bytes().
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top