text
stringlengths 1
254
| output
stringlengths 2
255
|
---|---|
Prev
|
ãã®äŸã¯ã $shm_id ãIDãšããå
±æã¡ã¢ãªããã㯠ãéããŸãã
|
Prev
|
(PHP 4 = 4.0.4)
|
shmop_delete() is used to delete a shared memory block.
|
shmop_delete() ã¯å
±æã¡ã¢ãªãããã¯ãåé€ããã ãã«äœ¿çšãããŸãã
|
On success 1 is returned, on failure 0 is returned.
|
shmop_delete() ã¯ã shmop_open() ã«ããäœæãããå
±æã¡ã¢ãªãããã¯ID shmid ãåŒæ°ãšããŸããæåæ ã«1ãè¿ãã倱æããéã«0ãè¿ããŸãã
|
Deleting shared memory block
|
äŸ 1å
±æã¡ã¢ãªãããã¯ã®åé€
|
This example will delete shared memory block identified by $shm_id.
|
ãã®äŸã¯ã $shm_id ãIDãšããå
±æã¡ã¢ãªããã㯠ãåé€ããŸãã
|
shmop_open() can create or open a shared memory block.
|
(PHP 4 = 4.0.4)
|
The second parameter are the flags that you can use:
|
shmop_open() ã¯å
±æã¡ã¢ãªãããã¯ãäœæãŸãã¯ãªãŒ ãã³ããŸãã
|
"c" for create (sets IPC_CREATE) use this flag when you need to create a new shared memory segment or if a segment with the same key exists, try to open it for read and write
|
shmop_open() ã¯æ¬¡ã®4ã€ã®åŒæ°ããšããŸã: keyã¯å
± æã¡ã¢ãªãããã¯ã®ã·ã¹ãã IDã§ããããã®ãã©ã¡ãŒã¿ã¯10鲿°ãŸã㯠16鲿°ã§æå®ããããšãå¯èœã§ãã2çªç®ã®ãã©ã¡ãŒã¿ã¯ flagsã§ããã æ¬¡ã®ãã®ãæå®å¯èœã§ãã
|
"n" create a new memory segment (sets IPC_CREATE_BAR_IPC_EXCL) use this flag when you want to create a new shared memory segment but if one already exists with the same flag, fail.
|
"a" ã¢ã¯ã»ã¹çš (IPC_EXCLãèšå®ãã) æ¢åã®å
±æã¡ã¢ãªã»ã°ã¡ã³ãããªãŒãã³ããå¿
èŠãããå Žåã«ãã®ã ã©ã°ã䜿çšããŠäžãã
|
Note:
|
"c" äœæçš (IPC_CREATEãèšå®ãã) æ°èŠã«å
±æã¡ã¢ãªã»ã°ã¡ã³ããå¿
èŠãªå Žåã«ãã®ãã©ã°ã䜿çšããŠäž ãã
|
On success shmop_open() will return an id that you can use to access the shared memory segment you've created.
|
æ³šæ æ³šæ: æ¢åã®ã¡ã¢ãªã»ã°ã¡ã³ãããªãŒãã³ããå Žåã«ã¯ã3çªç®ããã³ 4çªç®ã®åŒæ°ã«ã¯0ãæå®ããå¿
èŠããããŸããæåæã« shmop_open() ã¯äœæããå
±æã¡ã¢ãªã»ã°ã¡ã³ãã« ã¢ã¯ã»ã¹ããããã«äœ¿çšããIDãè¿ããŸãã
|
Create a new shared memory block
|
äŸ 1å
±æã¡ã¢ãªãããã¯ãæ°èŠã«äœæãã
|
This example opened a shared memory block with a system id of 0x0fff.
|
ãã®äŸã¯ãã·ã¹ãã ID 0x0fff ã®å
±æã¡ã¢ãªãããã¯ããªãŒãã³ããŸãã
|
Prev
|
(PHP 4 = 4.0.4)
|
shmop_read() will read a string from shared memory block.
|
shmop_read() ã¯å
±æã¡ã¢ãªãããã¯ããæååãèª ã¿èŸŒã¿ãŸãã
|
Example 1.
|
shmop_read() ã¯3ã€ã®åŒæ°ããšããŸããshmid㯠shmop_open() ã«ããäœæãããå
±æãããã¯IDã offsetã¯èªã¿å§ããäœçœ®ã®ãªãã»ãããcountã¯èªã¿èŸŒããã€ãæ°ã§ãã
|
?php $shm_data = shmop_read( $shm_id, 0, 50);?
|
äŸ 1å
±æã¡ã¢ãªãããã¯ãèªã¿èŸŒã
|
Prev
|
ãã®äŸã¯å
±æã¡ã¢ãªãããã¯ãã50ãã€ããèªã¿èŸŒãã§ã $shm_data ã®äžã®ããŒã¿ã«çœ®ããã®ã§ãã
|
Prev
|
(PHP 4 = 4.0.4)
|
shmop_size() is used to get the size, in bytes of the shared memory block.
|
shmop_size() ã¯å
±æã¡ã¢ãªãããã¯ã®å€§ãããåŸãã ãã«äœ¿çšãããŸãã
|
Example 1.
|
shmop_size() ã¯ã shmop_open() ã« ããäœæãããå
±æã¡ã¢ãªãããã¯ID shmid ãåŒæ°ãšããŸãããã®é¢æ° ã¯ãå
±æã¡ã¢ãªãããã¯ãå æãããã€ãæ°ãè¡šãæŽæ°ãè¿ããŸãã
|
?php $shm_size = shmop_size( $shm_id);?
|
äŸ 1å
±æã¡ã¢ãªãããã¯ã®å€§ãããåŸã
|
Prev
|
ãã®äŸã¯ã $shm_id ãIDãšããå
±æã¡ã¢ãªããã㯠ã®å€§ããã $shm_size ã«ä»£å
¥ããŸãã
|
Prev
|
(PHP 4 = 4.0.4)
|
(PHP 4 = 4.0.4)
|
shmop_write() ã¯å
±æã¡ã¢ãªãããã¯ã«æååãæž ã蟌ã¿ãŸãã
|
Writing to shared memory block
|
äŸ 1å
±æã¡ã¢ãªãããã¯ã«æžã蟌ã
|
This example will write data inside $my_string into shared memory block, $shm_bytes_written will contain the number of bytes written.
|
ãã®äŸã¯ãå
±æã¡ã¢ãªãããã¯ã« $my_string å
ã®ã㌠ã¿ãæžã蟌ã¿ãŸãã $shm_bytes_written ã«ã¯ãæž ã蟌ãã ãã€ãæ°ã代å
¥ãããŸãã
|
(PHP 3 = 3.0.6, PHP 4)
|
(PHP 3 = 3.0.6, PHP 4)
|
All variable-types are supported.
|
æå®ãã variable_key ãæãã 倿° variable ã®æ¿å
¥ãŸãã¯æŽæ°ãè¡ããŸãã å
šãŠã®å€æ°å (double, long, æåå, é
å)ããµããŒããããŸãã
|
Prev
|
泚æ ãã®é¢æ°ã¯ãWindowsã·ã¹ãã ã§ã¯åäœããŸããã
|
(PHP 3 = 3.0.6, PHP 4)
|
(PHP 3 = 3.0.6, PHP 4)
|
All data will be destroyed.
|
UNIXã·ã¹ãã ããå
±æã¡ã¢ãªãåé€ããŸããå
šãŠã®ããŒã¿ã¯ç Žæ£ãããŸãã
|
Prev
|
泚æ ãã®é¢æ°ã¯ãWindowsã·ã¹ãã ã§ã¯åäœããŸããã
|
Prev
|
(PHP 3 = 3.0.6, PHP 4)
|
Removes a variable with a given variable_key and frees the occupied memory.
|
æå®ãã variable_key ãæãã倿°ã å
±æã¡ã¢ãªããåé€ããå æããã¡ã¢ãªãè§£æŸããããšãã§ããŸãã
|
Prev
|
泚æ ãã®é¢æ°ã¯ãWindowsã·ã¹ãã ã§ã¯åäœããŸããã
|
Prev
|
(PHP 4)
|
This function is an alias to highlight_file().
|
show_source() 颿°ã¯ãçµèŸŒã¿ã®PHPçšæ§æãã€ã©ã€ ã衚瀺çšã«å®çŸ©ãããè²ã䜿çšã㊠filename ã® æ§æãã€ã©ã€ã衚瀺ãåºåããŸãã æåæã« TRUE ãããã§ãªãå Žåã« FALSE ãè¿ããŸãã(PHP 4)
|
For more information see the documentation there.
|
ãã®é¢æ°ã¯ã颿° highlight_file() ã®ãšã€ãªã¢ã¹ã§ ãã
|
Prev
|
泚æ 颿° show_source() ããã³ highlight_file() ã䜿çšããå Žåã«ã¯ããã¹ã¯ãŒ ããæœåšçãªã»ãã¥ãªãã£äžã®å±éºãçãé¡ã®ä»ã®æ
å ±ã®ãããªéèŠãª æ
å ±ãäžæ³šæã§å
¬éããŠããŸããªãããã«æ³šæããå¿
èŠããããŸãã
|
pack
|
highlight_string(), highlight_file() ãåç
§äžããã
|
function foo ($arg_1, $arg_2,..., $arg_n) {echo "Example function.\n"; return $retval;}
|
颿°ã¯æ¬¡ã®ãããªæ§æã§å®çŸ©ãããŸãã
|
In PHP 3, functions must be defined before they are referenced.
|
颿°ã®äžã§ã¯ãä»ã®é¢æ°ã ã¯ã©ã¹ å®çŸ© ãå«ã PHP ã®ããããæå¹ãªã³ãŒãã䜿çšããããšãã§ããŸãã
|
When a function is defined in a conditional manner such as the two examples shown.
|
PHP 3 ã§ã¯ã颿°ã¯åç
§ãããåã«å®çŸ©ãããŠããå¿
èŠããããŸããã PHP 4ã§ã¯ãã®ãããªå¶éã¯ãããŸããã
|
PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions.
|
PHP ã¯é¢æ°ã®ãªãŒããŒããŒãããµããŒãããŠããŸããã ãŸãã宣èšããã颿°ã®å®çŸ©ãåãæ¶ãããåå®çŸ©ããããšã ã§ããŸããã
|
PHP 4 supports both: see Variable-length argument lists and the function references for func_num_args(), func_get_arg(), and func_get_args() for more information.
|
PHP 3 ã§ã¯ãåŒæ°ã®ããã©ã«ãå€(詳现ã¯ã åŒæ°ã®ããã©ã«ãå€ ã åç
§äžãã)ã¯ãµããŒãããŠããŸããã颿°ã®åŒæ°ãå¯å€ãšããããšã¯ã§ ããŸãããPHP 4 ã¯äž¡æ¹ãšããµããŒãããŠããŸãã詳现ã¯ã å¯å€é·åŒæ°ãªã¹ã ããã³ func_num_args(), func_get_arg(), func_get_args() ã«é¢ãã颿°ãªãã¡ã¬ã³ã¹ã åç
§äžããã
|
Prev
|
(PHP 3 = 3.0.8, PHP 4)
|
This function shuffles (randomizes the order of the elements in) an array.
|
ãã®é¢æ°ã¯ã(èŠçŽ ã®é çªãã©ã³ãã ã«ããããã«)é
åãã·ã£ããã«ã ãŸãããã®é¢æ°ã«ã·ãŒããäžããããã« srand() ã 䜿çšããå¿
èŠããããŸãã
|
Example 1. shuffle() example
|
äŸ 1 shuffle() ã®äŸ
|
See also arsort(), asort(), ksort(), rsort(), sort(), and usort().
|
arsort(), asort(), ksort(), rsort(), sort(), usort() ãåç
§äžããã
|
This calculates the similarity between two strings as described in Oliver [1993].
|
(PHP 3 = 3.0.7, PHP 4)
|
Note also that the complexity of this algorithm is O( N**3) where N is the length of the longest string.
|
ãã®é¢æ°ã¯ãOliver [1993] ã«èšè¿°ãããããã«äºã€ã®æååã®éã®é¡ 䌌æ§ãèŠç©ãããŸãããã®å®è£
㯠Oliver ã®æ¬äŒŒã³ãŒãã®æ§ã«ã¹ã¿ã㯠ã䜿çšããããã»ã¹å
šäœã®éåºŠãæ¹åããããã©ããã«ãããããååž° çã³ãŒã«ãè¡ãããšã«æ³šæããŠäžããããã®ã¢ã«ãŽãªãºã ã®è€éãã¯ã O(N**3) ã§ããããšã«ã泚æããŠäžããããã ããN ã¯æãé·ãæåå ã®é·ãã§ãã
|
It returns the number of matching chars in both strings.
|
3çªç®ã®åŒæ°ãšããŠãªãã¡ã¬ã³ã¹ãæž¡ãããšã«ããã similar_text() ã¯é¡äŒŒæ§ãããŒã»ã³ãã§èšç®ã㟠ããäž¡æ¹ã®æååã§ãããããæåã®æ°ãè¿ããŸãã
|
Prev
|
(PHP 4 = 4.1.0)
|
Returns the hyperbolic sine of arg, defined as (exp(arg) - exp(-arg)) / 2.
|
(exp(arg) - exp(-arg))/2 ã§å®çŸ©ããã arg ã®åæ²ç·æ£åŒŠãè¿ããŸãã
|
Prev
|
sin(), asinh(), cos(), tan() ãåç
§äžããã
|
sin() returns the sine of the arg parameter.
|
(PHP 3, PHP 4)
|
?php / / Precision depends on your precision directive print sin( deg2rad(60)); / / 0.866025403... print sin(60); / / -0.304810621...?
|
ãµã€ã³ãã©ãžã¢ã³ã§è¿ããŸãã
|
Prev
|
cos() ãš tan() ãåç
§äžããã
|
Prev
|
(PHP 3, PHP 4)
|
The sizeof() function is an alias for count().
|
sizeof() ã¯ã count() ãžã®ãšã€ ãªã¢ã¹ã§ãã
|
Prev
|
count() ãåç
§äžããã
|
Prev
|
(PHP 3, PHP 4)
|
The sleep() function delays program execution for the given number of seconds.
|
颿° sleep() ã¯ã seconds ã§äžããããç§æ°åããã°ã©ã ã®å®è¡ãé
å»¶ãããŸãã
|
Prev
|
usleep() ãåç
§ã®ããšã
|
(PHP 3, PHP 4)
|
(PHP 3, PHP 4)
|
The snmpget() function is used to read the value of an SNMP object specified by the object_id.
|
æåãããSNMPãªããžã§ã¯ãã®å€ãã倱æããå Žåã« FALSE ãè¿ããŸãã
|
$syscontact = snmpget( "127.0.0.1", "public", "system.SysContact.0");
|
snmpget() 㯠object_id ã§ æå®ãããSNMPãªããžã§ã¯ãã®å€ãèªã¿ãšãããã«äœ¿çšãããŸãã SNMPãšãŒãžã§ã³ãã hostname ã§æå®ãã ãªãŒãã³ãã¥ããã£ããã©ã¡ãŒã¿ community ã§æå®ããŸãã
|
Prev
|
(PHP 3 = 3.0.8, PHP 4)
|
Returns the current value stored in the UCD Library for quick_print. quick_print is off by default.
|
UCD ã©ã€ãã©ãªã«ä¿æããã quick_print ã®çŸåšã®å€ãè¿ããŸãã ããã©ã«ãã§ã¯ãquick_print ã¯ãªãã§ãã
|
Above function call would return FALSE if quick_print is off, and TRUE if quick_print is on.
|
äžã®é¢æ°ã³ãŒã«ã¯ãquick_print ããªãã®å Žåã« FALSE ãquick_print ããªã³ã®å Žåã« TRUE ãè¿ããŸãã
|
This function is not available when using the Windows SNMP library.
|
snmp_get_quick_print() ã¯ãUCB SNMP ã©ã€ãã©ãªã 䜿çšããŠããå Žåã®ã¿å©çšå¯èœã§ãã ãã®é¢æ°ã¯ãWindows SNMP ã©ã€ãã©ãªã䜿çšããŠããå Žåã¯å©çšã§ã㟠ããã
|
Prev
|
åç
§: snmp_set_quick_print() ã« quick_print 㮠圹å²ã«é¢ãã詳现ãªèª¬æããããŸãã
|
Warning
|
(PHP 3 = 3.0.8, PHP 4)
|
Prev
|
ãã®é¢æ°ã¯ã çŸåšã®ãšããè©³çŽ°ãªæ
å ±ã¯ãããŸãããåŒæ°ã®ãªã¹ãã®ã¿ã èšè¿°ãããŠããŸãã
|
Prev
|
(PHP 3 = 3.0.12, PHP 4)
|
Sets the specified SNMP object value, returning TRUE on success and FALSE on error.
|
æå®ãã SNMP ãªããžã§ã¯ãã®å€ãèšå®ããæåæã« TRUE ããšã©ãŒæ ã« FALSE ãè¿ããŸãã
|
SNMP agent is specified by the hostname and the read community is specified by the community parameter.
|
snmpset() 颿°ã¯ã object_id ã§æå®ããã SNMP ãªããžã§ã¯ãã® å€ãèšå®ããããã«äœ¿çšãããŸããSNMP ãšãŒãžã§ã³ãã hostname ã§æå®ãããªãŒãã³ãã¥ããã£ã community ãã©ã¡ãŒã¿ã§æå®ããŸãã
|
(PHP 3 = 3.0.8, PHP 4)
|
(PHP 3 = 3.0.8, PHP 4)
|
When quick_print is not enabled (default) the UCD SNMP library prints extra information including the type of the value (i.e.
|
quick_print ã®èšå®ã¯ãè¿ãããæ
å ±ãåå³ããŠãã衚瀺ããå Žå㫠䜿çšãããããšãå€ãã§ãã
|
Setting quick_print is often used when using the information returned rather then displaying it.
|
æåã«åºåãããå€ã¯ã'Timeticks: (0) 0:00:00.00' ã®ããã«ãªããŸãã äžæ¹ãquick_print ãæå¹ã«ããåŸã¯ã0:00:00.00' ãåºåãããŸãã
|
The first value printed might be: 'Timeticks: (0) 0:00:00.00', whereas with quick_print enabled, just '0:00:00.00' would be printed.
|
ããã©ã«ãã§ãUCD SNMP ã©ã€ãã©ãªã¯åé·ãªå€ãè¿ããŸãã quick_print ã¯ãå€ã®ã¿ãè¿ãããã«çšããããŸãã
|
Currently strings are still returned with extra quotes, this will be corrected in a later release.
|
çŸåšãæååã¯åŒçšç¬Šã§æ¬ãããŠè¿ãããŸããããã®åäœã¯å°æ¥ã® ãªãªãŒã¹ã§ã¯ä¿®æ£ãããäºå®ã§ãã
|
This function is not available when using the Windows SNMP library.
|
snmp_set_quick_print() ã¯ãUCD SNMP ã©ã€ãã©ãª ã䜿çšããŠããå Žåã®ã¿å©çšå¯èœã§ãã ãã®é¢æ°ã¯ãWindows SNMP ã©ã€ãã©ãªã䜿çšããŠããå Žåã«ã¯ å©çšã§ããŸããã
|
Returns an array of SNMP object values starting from the object_id as root and FALSE on error.
|
(PHP 3, PHP 4)
|
Community specifies the read community for that agent.
|
object_id() ããã«ãŒããšããŠSNMPãªããžã§ã¯ã ã®å€ãé
åãšããŠè¿ããŸãããšã©ãŒã®å Žåã« FALSE ãè¿ããŸãã
|
If object_id is specified, all the SNMP objects below that object_id are returned.
|
snmpwalk() 颿°ã¯ hostname ã§æå®ããSNMPãšãŒãžã§ã³ãããå
šãŠã®å€ãèªã¿ãšãã®ã«äœ¿çšãããŸãã community ã¯ããã®ãšãŒãžã§ã³ãã«å¯Ÿãã ãªãŒãã³ãã¥ããã£ãæå®ããŸãã空㮠object_id ã¯ãSNMPãªããžã§ã¯ãããªãŒã®ã«ãŒããšããŠè§£éãããããªãŒã®äžã®å
šãŠã® ãªããžã§ã¯ããé
åãšããŠè¿ãããŸãã object_id ãæå®ãããå Žåã ãã® object_id ã®äžã® å
šãŠã®SNMPãªããžã§ã¯ããè¿ãããŸãã
|
Above function call would return all the SNMP objects from the SNMP agent running on localhost.
|
äžèšã®é¢æ°ã³ãŒã«ã¯ãããŒã«ã«ãã¹ãäžã§çšŒåããSNMP ãšãŒãžã§ã³ãããå
šãŠã®SNMPãªããžã§ã¯ããè¿ããŸãã ã«ãŒãåŠçã«ããå€ãäžã€ãã€ãšãã ãããšãã§ããŸãã
|
(PHP 3 = 3.0.8, PHP 4)
|
(PHP 3 = 3.0.8, PHP 4)
|
snmpwalkoid() function is used to read all object ids and their respective values from an SNMP agent specified by the hostname.
|
åãªããžã§ã¯ãã®IDãšãã®å€ãã«ãŒããšããŠæå®ãã object_id ããå§ãŸã飿³é
åãšããŠè¿ããŸãã ãšã©ãŒã®å Žå㯠FALSE ãè¿ããŸãã
|
Both functions are provided for backward compatibility.
|
snmpwalkoid() ããã³ snmpwalk() ãããã®ã¯ããããŸã§ã®çµç·¯ ã«ãããŸãã äž¡æ¹ã®é¢æ°ã¯ãäžäœäºæã®ããã«æäŸãããŠããŸãã
|
Above function call would return all the SNMP objects from the SNMP agent running on localhost.
|
äžã®é¢æ°ã³ãŒã«ã¯ãlocalhost ã§å®è¡ãããŠãã SNMP ãšãŒãžã§ã³ããã å
šãŠã® SNMP ãªããžã§ã¯ããè¿ããŸãã åå€ã¯ã次ã®ã«ãŒãã«ããåãåºãããšãã§ããŸãã
|
Use this function at your own risk.
|
(PHP 4 = 4.1.0)
|
Once a successful connection is made, a new socket resource is returned, which may be used for communication.
|
ãã®é¢æ°ã¯ã å®éšç ãªã¹ããŒã¿ã¹ã«ãããŸããããã¯ããã®é¢æ°ã® åäœã颿°åãããã§æžãããŠããããšå
šãŠãPHPã®å°æ¥ã®ããŒãžã§ã³ã§äºå ãªã倿Žãããå¯èœæ§ãããããšãæå³ããŸããæ³šæãåèµ·ãããšãšãã«èªå ã®ãªã¹ã¯ã§ãã®é¢æ°ã䜿çšããŠäžããã
|
The socket resource returned by socket_accept() may not be used to accept new connections.
|
socket_accept() ã«ããè¿ããããœã±ããèšè¿°åã¯ã æ°èŠæ¥ç¶ãèš±å¯ããããã«äœ¿çšããããšã¯ã§ããŸããããã®å Žåã§ãå
ã®æ¥ç¶åŸ
ã¡ã®ãœã±ãã socket ã¯ããªãŒãã³ã ãããŸãŸã§ãããå䜿çšå¯èœã§ãã
|
Returns a new socket resource on success, or FALSE on error.
|
æåæã«æ°èŠãœã±ããèšè¿°åãè¿ãã倱ææã«è² ã®ãšã©ãŒã³ãŒããè¿ã ãŸãããã®ã³ãŒãã¯ããšã©ãŒã®å
容ãæååã§ååŸããããã« socket_strerror() ã«æž¡ãããšãå¯èœã§ãã
|
See also socket_bind(), socket_connect(), socket_listen(), socket_create(), and socket_strerror().
|
socket_bind(), socket_connect(), socket_listen(), socket_create(), socket_get_status(), socket_strerror() ãåç
§äžããã
|
Warning
|
(4.0.2 - 4.0.6 only)
|
The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP.
|
ãã®é¢æ°ã¯ã å®éšç ãªã¹ããŒã¿ã¹ã«ãããŸããããã¯ããã®é¢æ°ã® åäœã颿°åãããã§æžãããŠããããšå
šãŠãPHPã®å°æ¥ã®ããŒãžã§ã³ã§äºå ãªã倿Žãããå¯èœæ§ãããããšãæå³ããŸããæ³šæãåèµ·ãããšãšãã«èªå ã®ãªã¹ã¯ã§ãã®é¢æ°ã䜿çšããŠäžããã
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.