Skip to content

cPeriod::Contains()

Rainer Stötter edited this page Apr 28, 2017 · 14 revisions

Method Contains( )

 public   boolean libdatephp\cPeriod::Contains(mixed $obj)

Contains() returns true, if $obj is part of the managed period of time

Example:

use libdatephp;

$p1 = new cPeriod( new cDate( 11, 23, 2016 ), new cDate( 11, 25, 2016 ) ); $p2 = new cPeriod( new cDate( 11, 23, 2016 ), new cDate( 11, 23, 2016 ) );

if ( $p1->Contains( $p2 ) ) do_something( );

Arguments

  • $obj mixed - <p>the other period of time or a cDate</p>

Returns

boolean true if the managed period of time contains $obj

Clone this wiki locally