« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 253 for found (0.002 sec.)
配列に値があるかチェックする 8351
« extract key » PHP Manual 配列 関数 配列に値があるかチェックする 検索 in_array (PHP 4, PHP 5, PHP 7, PHP 8) in_array — 配列に値があるかチェックする 説明 function in_array ( mixed $needle , array $haystack , bool $strict = false ): bool hay ... を指定した in_array() の例 <?php $a = array( '1.10' , 12.4 , 1.13 ); if ( in_array ( '12.4' , $a , true )) { echo "'12.4' found with strict check\n" ; } if ( in_array ( 1.13 , $a , true )) { echo "1.13 found with strict check\n" ; } ?> 上の例の出力は ... 以下となります。 1.13 found with strict check 例3 needleが配列の場合の in_array() <?php $a = array(array( 'p' , 'h' ), array( 'p' , 'r' ), 'o' ); if ( ... in_array (array( 'p' , 'h' ), $a )) { echo "'ph' was found\n" ; } if ( in_array (array( 'f' , 'i' ), $a )) { echo "'fi' was found\n" ; } if ( in_array ( 'o' , $a )) { echo "'o' was ...
https://man.mtool.work/php/8.3/function.in-array.html
配列に値があるかチェックする 8351
« extract key » PHP Manual 配列 関数 配列に値があるかチェックする 検索 in_array (PHP 4, PHP 5, PHP 7, PHP 8) in_array — 配列に値があるかチェックする 説明 function in_array ( mixed $needle , array $haystack , bool $strict = false ): bool hay ... を指定した in_array() の例 <?php $a = array( '1.10' , 12.4 , 1.13 ); if ( in_array ( '12.4' , $a , true )) { echo "'12.4' found with strict check\n" ; } if ( in_array ( 1.13 , $a , true )) { echo "1.13 found with strict check\n" ; } ?> 上の例の出力は ... 以下となります。 1.13 found with strict check 例3 needleが配列の場合の in_array() <?php $a = array(array( 'p' , 'h' ), array( 'p' , 'r' ), 'o' ); if ( ... in_array (array( 'p' , 'h' ), $a )) { echo "'ph' was found\n" ; } if ( in_array (array( 'f' , 'i' ), $a )) { echo "'fi' was found\n" ; } if ( in_array ( 'o' , $a )) { echo "'o' was ...
https://man.mtool.work/php/8.3/function.in-array.html
This method checks whether a key is part of the hash 7702
« QuickHashIntHash::delete QuickHashIntHash::get » PHP Manual QuickHashIntHash This method checks whether a key is part of the hash 検索 QuickHashIntHash::exists (PECL quickhash >= Unknown) QuickHashIntHash::exists — This method checks whet ... sh. パラメータ key The key of the entry to check for whether it exists in the hash. 戻り値 Returns true when the entry was found, or false when the entry is not found. 例 例1 QuickHashIntHash::exists() example <?php //generate 200000 elements $array = ... tingEntries = array_rand ( array_flip ( $array ), 180000 ); $testForEntries = array_rand ( array_flip ( $array ), 1000 ); $foundCount = 0 ; echo "Creating hash: " , microtime ( true ), "\n" ; $hash = new QuickHashIntHash ( 100000 ); echo "Adding eleme ... $hash -> add ( $key , 56 ); } echo "Doing 1000 tests: " , microtime ( true ), "\n" ; foreach( $testForEntries as $key ) { $foundCount += $hash -> exists ( $key ); } echo "Done, $foundCount found: " , microtime ( true ), "\n" ; ?> 上の例の出力は、 たと ...
https://man.mtool.work/php/8.3/quickhashinthash.exists.html
This method checks whether a key is part of the set 7702
« QuickHashIntSet::delete QuickHashIntSet::getSize » PHP Manual QuickHashIntSet This method checks whether a key is part of the set 検索 QuickHashIntSet::exists (PECL quickhash >= Unknown) QuickHashIntSet::exists — This method checks whethe ... set. パラメータ key The key of the entry to check for whether it exists in the set. 戻り値 Returns true when the entry was found, or false when the entry is not found. 例 例1 QuickHashIntSet::exists() example <?php //generate 200000 elements $array = ... tingEntries = array_rand ( array_flip ( $array ), 180000 ); $testForEntries = array_rand ( array_flip ( $array ), 1000 ); $foundCount = 0 ; echo "Creating set: " , microtime ( true ), "\n" ; $set = new QuickHashIntSet ( 100000 ); echo "Adding elements ... y ) { $set -> add ( $key ); } echo "Doing 1000 tests: " , microtime ( true ), "\n" ; foreach( $testForEntries as $key ) { $foundCount += $set -> exists ( $key ); } echo "Done, $foundCount found: " , microtime ( true ), "\n" ; ?> 上の例の出力は、 たとえ ...
https://man.mtool.work/php/8.3/quickhashintset.exists.html
This method checks whether a key is part of the hash 7702
« QuickHashIntHash::delete QuickHashIntHash::get » PHP Manual QuickHashIntHash This method checks whether a key is part of the hash 検索 QuickHashIntHash::exists (PECL quickhash >= Unknown) QuickHashIntHash::exists — This method checks whet ... sh. パラメータ key The key of the entry to check for whether it exists in the hash. 戻り値 Returns true when the entry was found, or false when the entry is not found. 例 例1 QuickHashIntHash::exists() example <?php //generate 200000 elements $array = ... tingEntries = array_rand ( array_flip ( $array ), 180000 ); $testForEntries = array_rand ( array_flip ( $array ), 1000 ); $foundCount = 0 ; echo "Creating hash: " , microtime ( true ), "\n" ; $hash = new QuickHashIntHash ( 100000 ); echo "Adding eleme ... $hash -> add ( $key , 56 ); } echo "Doing 1000 tests: " , microtime ( true ), "\n" ; foreach( $testForEntries as $key ) { $foundCount += $hash -> exists ( $key ); } echo "Done, $foundCount found: " , microtime ( true ), "\n" ; ?> 上の例の出力は、 たと ...
https://man.mtool.work/php/8.3/quickhashinthash.exists.html
This method checks whether a key is part of the set 7702
« QuickHashIntSet::delete QuickHashIntSet::getSize » PHP Manual QuickHashIntSet This method checks whether a key is part of the set 検索 QuickHashIntSet::exists (PECL quickhash >= Unknown) QuickHashIntSet::exists — This method checks whethe ... set. パラメータ key The key of the entry to check for whether it exists in the set. 戻り値 Returns true when the entry was found, or false when the entry is not found. 例 例1 QuickHashIntSet::exists() example <?php //generate 200000 elements $array = ... tingEntries = array_rand ( array_flip ( $array ), 180000 ); $testForEntries = array_rand ( array_flip ( $array ), 1000 ); $foundCount = 0 ; echo "Creating set: " , microtime ( true ), "\n" ; $set = new QuickHashIntSet ( 100000 ); echo "Adding elements ... y ) { $set -> add ( $key ); } echo "Doing 1000 tests: " , microtime ( true ), "\n" ; foreach( $testForEntries as $key ) { $foundCount += $set -> exists ( $key ); } echo "Done, $foundCount found: " , microtime ( true ), "\n" ; ?> 上の例の出力は、 たとえ ...
https://man.mtool.work/php/8.3/quickhashintset.exists.html
Removes and returns a value by key 7412
« Ds\Map::reduce Ds\Map::reverse » PHP Manual Ds\Map Removes and returns a value by key 検索 Ds\Map::remove (PECL ds >= 1.0.0) Ds\Map::remove — Removes and returns a value by key 説明 public function Ds\Map::remove ( mixed $key , mixed $def ... ault = ? ): mixed Removes and returns a value by key, or return an optional default value if the key could not be found. 注意 : Keys of type object are supported. If an object implements Ds\Hashable , equality will be determined by the object ... g key. See Arrays . パラメータ key The key to remove. default The optional default value, returned if the key could not be found. 戻り値 The value that was removed, or the default value if provided and the key could not be found in the map. エラー / 例 ... 外 OutOfBoundsException if the key could not be found and a default value was not provided. 例 例1 Ds\Map::remove() example <?php $map = new \Ds\Map ([ "a" => 1 , "b" => 2 , "c ...
https://man.mtool.work/php/8.3/ds-map.remove.html
指定された部分文字列が、文字列に含まれるかを調べる 7412
« sscanf str_decrement » PHP Manual String 関数 指定された部分文字列が、文字列に含まれるかを調べる 検索 str_contains (PHP 8) str_contains — 指定された部分文字列が、文字列に含まれるかを調べる 説明 function str_contains ( string $haystack , s ... php $string = 'The lazy fox jumped over the fence' ; if ( str_contains ( $string , 'lazy' )) { echo "The string 'lazy' was found in the string\n" ; } if ( str_contains ( $string , 'Lazy' )) { echo 'The string "Lazy" was found in the string' ; } else { ... echo '"Lazy" was not found because the case does not match' ; } ?> 上の例の出力は以下となります。 The string 'lazy' was found in the string "Lazy" wa ... s not found because the case does not match 注意 注意 : この関数はバイナリデータに対応しています。 参考 str_ends_with() - 文字列が、指 ...
https://man.mtool.work/php/8.3/function.str-contains.html
Removes and returns a value by key 7412
« Ds\Map::reduce Ds\Map::reverse » PHP Manual Ds\Map Removes and returns a value by key 検索 Ds\Map::remove (PECL ds >= 1.0.0) Ds\Map::remove — Removes and returns a value by key 説明 public function Ds\Map::remove ( mixed $key , mixed $def ... ault = ? ): mixed Removes and returns a value by key, or return an optional default value if the key could not be found. 注意 : Keys of type object are supported. If an object implements Ds\Hashable , equality will be determined by the object ... g key. See Arrays . パラメータ key The key to remove. default The optional default value, returned if the key could not be found. 戻り値 The value that was removed, or the default value if provided and the key could not be found in the map. エラー / 例 ... 外 OutOfBoundsException if the key could not be found and a default value was not provided. 例 例1 Ds\Map::remove() example <?php $map = new \Ds\Map ([ "a" => 1 , "b" => 2 , "c ...
https://man.mtool.work/php/8.3/ds-map.remove.html
指定された部分文字列が、文字列に含まれるかを調べる 7412
« sscanf str_decrement » PHP Manual String 関数 指定された部分文字列が、文字列に含まれるかを調べる 検索 str_contains (PHP 8) str_contains — 指定された部分文字列が、文字列に含まれるかを調べる 説明 function str_contains ( string $haystack , s ... php $string = 'The lazy fox jumped over the fence' ; if ( str_contains ( $string , 'lazy' )) { echo "The string 'lazy' was found in the string\n" ; } if ( str_contains ( $string , 'Lazy' )) { echo 'The string "Lazy" was found in the string' ; } else { ... echo '"Lazy" was not found because the case does not match' ; } ?> 上の例の出力は以下となります。 The string 'lazy' was found in the string "Lazy" wa ... s not found because the case does not match 注意 注意 : この関数はバイナリデータに対応しています。 参考 str_ends_with() - 文字列が、指 ...
https://man.mtool.work/php/8.3/function.str-contains.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT