You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_**Description**_: Adds the string value to the head (left) of the list. Creates the list if the key didn't exist. If the key exists and is not a list, `FALSE` is returned.
1926
+
_**Description**_: Adds one or more values to the head of a LIST. Creates the list if the key didn't exist. If the key exists and is not a list, `FALSE` is returned.
1927
1927
1928
-
##### *Parameters*
1929
-
*key*
1930
-
*value* String, value to push in key
1928
+
##### *Prototype*
1929
+
~~~php
1930
+
$redis->lPush($key, $entry [, $entry, $entry]);
1931
+
~~~
1931
1932
1932
1933
##### *Return value*
1933
1934
*LONG* The new length of the list in case of success, `FALSE` in case of Failure.
1934
1935
1935
1936
##### *Examples*
1936
1937
~~~php
1937
1938
$redis->del('key1');
1938
-
$redis->lPush('key1', 'C'); // returns 1
1939
-
$redis->lPush('key1', 'B'); // returns 2
1940
-
$redis->lPush('key1', 'A'); // returns 3
1941
-
/* key1 now points to the following list: [ 'A', 'B', 'C' ] */
_**Description**_: Adds the string value to the tail (right) of the list. Creates the list if the key didn't exist. If the key exists and is not a list, `FALSE` is returned.
2134
+
_**Description**_: Adds one or more entries to the tail of a LIST. Redis will create the list if it doesn't exist.
2131
2135
2132
-
##### *Parameters*
2133
-
*key*
2134
-
*value* String, value to push in key
2136
+
##### *Prototype*
2137
+
~~~php
2138
+
$redis->rPush($key, $entry [, $entry, $entry]);
2139
+
~~~
2135
2140
2136
2141
##### *Return value*
2137
2142
*LONG* The new length of the list in case of success, `FALSE` in case of Failure.
2138
2143
2139
2144
##### *Examples*
2140
2145
~~~php
2141
2146
$redis->del('key1');
2142
-
$redis->rPush('key1', 'A'); // returns 1
2143
-
$redis->rPush('key1', 'B'); // returns 2
2144
-
$redis->rPush('key1', 'C'); // returns 3
2145
-
/* key1 now points to the following list: [ 'A', 'B', 'C' ] */
0 commit comments