php - Undefined offset in custom codeigniter library, what am i doing wrong? -


I have a visual php error in my code, which does two errors with $ time and $ date array Php says message: Undefined Offset: both $ 1 and 2 for date and $ date

So I have exploded () the keys after, are undefined? Why is it absolutely and? And how do I solve this issue? Array display results array ([0] = & gt; 05 [1] => 51 [2] =>> 00) array ([0] => 1984 [1] ] = & Gt; 06 [2] => 23)

I tried a lot, nobody seems to work. I am not remembering that I had raised this issue earlier ... I would almost start thinking that maybe there could be anything in the problem with the codiginator?

  & lt ?? Php if (! Defined ('BaseP')) Exit ('no direct script entry is allowed'); Square self {public $ julian_ut = null; Public $ config = array (); Public $ chart_id = ''; Public $ user_id = ''; Public $ chart_name = ''; Public $ chart_time = ''; Public $ chart_date = ''; Public $ chart_search = ''; Public $ chart_timezone = ''; Public $ chart_house = ''; Public $ chart_land = ''; Public $ chart_latitude = ''; Public $ time = array (); Public $ date = array (); / *** * Start Description of Chart ** / Public Function __ Composition ($ config = array ()) {// For example, this-> CI = & amp; get Instance(); // Preliminary and loads of ifiree files from directory swe_set_ephe_path (FCPATH.'Effereis'); // configuration object creates an object from foreach ($ config = $ value = & gt; $ value) {$ this- & gt; $ Property = $ value; } // Time to create time and date = $ explosion (":", $ this-> chart_time); $ Date = explosion ("-", $ this-> chart_date); // Julian de Dollar-is-> Julian_t = purse_julde (interval ($ date [0]), $ date [1], $ date [2], ($ time [0] + $ time [1] / 60 + $ time [2] / 3600), SE_GREG_CAL ); } / *** * Time to return to Julian day number / day ** / public function get_julian_ut () {return $ this- & gt; Julian_ut; }}  

** errors **

encountered a PHP error

Seriousness: Notice

Message: Undefined Offset: 1

File Name: Library / Swap

Line Number: 61

A PHP Error

Seriousness: Notice

Message: Undefined Offset: 2

File name: Library / Swap. PHP

Line Number: 61

Seriousness: Notification

Message: Undefined Offset: 1

File Name: Library / Selfieff.php

Message: Undefined Offset: 2

Line Number: 61

Update: forgot to enter results from Eray's database and added errors.

Check it's var_dump () and then < Strong> index accordingly.

  $ time = explosion (":", $ this-> chart_time); Var_dump ($ time); $ Date = explosion ("-", $ this-> chart_date); Var_dump ($ date);  

But to get the date, time or time from date, time or time, not correctly .


Recommended:

  & lt; Php $ date = '2015-01-22'; $ Time = '18: 16: 12 '; $ Dt = new date time ($ date); $ Tm = new date time ($ time); $ Day = $ dt-> Format ('D'); $ Month = $ dt- & gt; Format ('m'); $ Year = $ dt-> Format ('Y'); $ Hour = $ tm- & gt; Format ('h'); $ Min = $ tm- & gt; Format ('i'); $ Sec = $ tm- & gt; Format ('s');  


Demo:


Documentation:


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -