From 064a1a2ec466e33be0e4db8ab1b40839900a1b7d Mon Sep 17 00:00:00 2001 From: MMZ Date: Fri, 12 May 2023 23:52:26 +0300 Subject: [PATCH 01/19] added str-repeat.md in str-repeat folder in string functions (First Version) --- .../terms/str-repeat/str-repeat | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 content/php/concepts/string-functions/terms/str-repeat/str-repeat diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat new file mode 100644 index 00000000000..fd45f7e8ecd --- /dev/null +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -0,0 +1,56 @@ +--- +Title: 'str_replace()' +Description: 'Returns a string with occurrences of a specified substring replaced by another string.' +Subjects: + - 'Computer Science' + - 'Web Design' + - 'Web Development' +Tags: + - 'Strings' + - 'Functions' +CatalogContent: + - 'learn-php' + - 'paths/computer-science' +--- + +--- +Title: 'str_replace()' +Description: 'Returns a string with occurrences of a specified substring replaced by another string.' +Subjects: + - 'Computer Science' + - 'Web Design' + - 'Web Development' +Tags: + - 'Strings' + - 'Functions' +CatalogContent: + - 'learn-php' + - 'paths/computer-science' +--- + +# str_repeat() + +The `str_repeat()` function repeats a string a specified number of times. + +## Syntax + +```pseudo +str_replace($string, $repeat) +``` + +- ```$string``` Specifies the string to repeat and it is required. +- ```$repeat``` Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. + +## Code Byte Example + +This example provides a few demonstrations of `str_repeat()` operating on a string. +```codebyte/php + +``` +Notice How the third echo statment doesn't apear in the output do it being repeated zero times . From 149e305e73e6e1bf666a1e28930899702f89f3c5 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:31:54 +0300 Subject: [PATCH 02/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index fd45f7e8ecd..a75dbde4d88 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -1,5 +1,5 @@ --- -Title: 'str_replace()' +Title: 'str_repeat()' Description: 'Returns a string with occurrences of a specified substring replaced by another string.' Subjects: - 'Computer Science' From 6e6ba63480406480275a34a35958a69588855a64 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:33:06 +0300 Subject: [PATCH 03/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index a75dbde4d88..b5e3f55da48 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -1,6 +1,6 @@ --- Title: 'str_repeat()' -Description: 'Returns a string with occurrences of a specified substring replaced by another string.' +Description: 'Returns a string with occurrences of a specified substring repeated a specified number of times.' Subjects: - 'Computer Science' - 'Web Design' From 732a63310249a48659408e924d72a9b79a191a04 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:33:14 +0300 Subject: [PATCH 04/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index b5e3f55da48..d3f2faffc29 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -30,7 +30,7 @@ CatalogContent: # str_repeat() -The `str_repeat()` function repeats a string a specified number of times. +The `str_repeat()` function returns a string that repeats a substring a specified number of times. ## Syntax From 6f4e048f0442deca1846d9151be3748bc5b2f2be Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:33:47 +0300 Subject: [PATCH 05/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index d3f2faffc29..0cbffd9a07f 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -38,7 +38,7 @@ The `str_repeat()` function returns a string that repeats a substring a specifie str_replace($string, $repeat) ``` -- ```$string``` Specifies the string to repeat and it is required. +- `$string`: Specifies the string to repeat and it is required. - ```$repeat``` Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. ## Code Byte Example From 3925e5fd1c236f2f1c1bb796329b0a9da661a1ed Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:35:06 +0300 Subject: [PATCH 06/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 0cbffd9a07f..8079af0cba0 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -53,4 +53,5 @@ echo (str_repeat("I-don't-apear",0). "\n"); ?> ``` -Notice How the third echo statment doesn't apear in the output do it being repeated zero times . + +Notice how the third `echo` statement doesn't appear in the output due it being repeated zero times. From d7ea8bbfca55861e77ba1c74682d81b541507f30 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:35:59 +0300 Subject: [PATCH 07/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 1 + 1 file changed, 1 insertion(+) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 8079af0cba0..e60d634da92 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -44,6 +44,7 @@ str_replace($string, $repeat) ## Code Byte Example This example provides a few demonstrations of `str_repeat()` operating on a string. + ```codebyte/php Date: Sun, 14 May 2023 00:36:08 +0300 Subject: [PATCH 08/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index e60d634da92..c29f2f2498d 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -41,7 +41,7 @@ str_replace($string, $repeat) - `$string`: Specifies the string to repeat and it is required. - ```$repeat``` Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. -## Code Byte Example +## Codebyte Example This example provides a few demonstrations of `str_repeat()` operating on a string. From 84fc28d40d7297c2a7a59b6850c7eb2b3b439885 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 00:36:16 +0300 Subject: [PATCH 09/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index c29f2f2498d..b8d7c9f60b8 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -39,7 +39,7 @@ str_replace($string, $repeat) ``` - `$string`: Specifies the string to repeat and it is required. -- ```$repeat``` Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. +- `$repeat`: Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. ## Codebyte Example From a4529ff69b9bb83e1ca4c74ef3bebe1a83dedfe0 Mon Sep 17 00:00:00 2001 From: MMMMMMMZ Date: Sun, 14 May 2023 00:43:20 +0300 Subject: [PATCH 10/19] Removed Repeated metadata --- .../string-functions/terms/str-repeat/str-repeat | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index b8d7c9f60b8..bd8604e3ded 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -13,21 +13,6 @@ CatalogContent: - 'paths/computer-science' --- ---- -Title: 'str_replace()' -Description: 'Returns a string with occurrences of a specified substring replaced by another string.' -Subjects: - - 'Computer Science' - - 'Web Design' - - 'Web Development' -Tags: - - 'Strings' - - 'Functions' -CatalogContent: - - 'learn-php' - - 'paths/computer-science' ---- - # str_repeat() The `str_repeat()` function returns a string that repeats a substring a specified number of times. From e5fece14f54cece6557a23b248606962187addca Mon Sep 17 00:00:00 2001 From: MMMMMMMZ Date: Sun, 14 May 2023 00:43:45 +0300 Subject: [PATCH 11/19] Removed Header --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index bd8604e3ded..20de962d05e 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -13,8 +13,6 @@ CatalogContent: - 'paths/computer-science' --- -# str_repeat() - The `str_repeat()` function returns a string that repeats a substring a specified number of times. ## Syntax From 43b6b9d314d119d67231b530bb8aaf7e7c3be69f Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sun, 14 May 2023 15:28:13 +0300 Subject: [PATCH 12/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 20de962d05e..57efd1b12df 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -21,7 +21,7 @@ The `str_repeat()` function returns a string that repeats a substring a specifie str_replace($string, $repeat) ``` -- `$string`: Specifies the string to repeat and it is required. +- `$string`: Specifies the string to repeat and it is required. - `$repeat`: Specifies the number of times the string will be repeated. Must be greater or equal to 0 and it is also required. ## Codebyte Example From 296566a08ae7c0cf1f4120926e0c5ace9b20a75b Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sat, 27 May 2023 18:26:29 +0300 Subject: [PATCH 13/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: KTom101 --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 57efd1b12df..4024a7b38d3 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -33,7 +33,7 @@ This example provides a few demonstrations of `str_repeat()` operating on a stri echo (str_repeat("I-am-repeated",3)."\n"); echo (str_repeat("Cool",10). "\n"); -echo (str_repeat("I-don't-apear",0). "\n"); +echo (str_repeat("I-don't-appear ",0). "\n"); ?> ``` From c79edb481d85fe8c4e8e6e70566123abd50e2630 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sat, 27 May 2023 18:26:40 +0300 Subject: [PATCH 14/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: KTom101 --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 1 - 1 file changed, 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 4024a7b38d3..b9a758a1601 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -38,4 +38,3 @@ echo (str_repeat("I-don't-appear ",0). "\n"); ?> ``` -Notice how the third `echo` statement doesn't appear in the output due it being repeated zero times. From 3e7a0901f3041b4cd195ada21a51ad0bd59da9a8 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sat, 27 May 2023 18:26:51 +0300 Subject: [PATCH 15/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: KTom101 --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index b9a758a1601..5acbf563410 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -28,6 +28,8 @@ str_replace($string, $repeat) This example provides a few demonstrations of `str_repeat()` operating on a string. +> **Note:** The third echo statement will not output to the console due to the second argument of `str_repeat` being set to `0`. + ```codebyte/php Date: Sat, 27 May 2023 18:27:04 +0300 Subject: [PATCH 16/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: KTom101 --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index 5acbf563410..be8003f507d 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -34,7 +34,7 @@ This example provides a few demonstrations of `str_repeat()` operating on a stri From 6b6a52e14b9d5246a5f1c3551fc6f26e89c25ed6 Mon Sep 17 00:00:00 2001 From: MMZ <90362625+MMMMMMMZ@users.noreply.github.com> Date: Sat, 27 May 2023 18:27:12 +0300 Subject: [PATCH 17/19] Update content/php/concepts/string-functions/terms/str-repeat/str-repeat Co-authored-by: KTom101 --- .../php/concepts/string-functions/terms/str-repeat/str-repeat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat index be8003f507d..faf87cc78f5 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat @@ -33,7 +33,7 @@ This example provides a few demonstrations of `str_repeat()` operating on a stri ```codebyte/php Date: Sat, 27 May 2023 11:34:46 -0400 Subject: [PATCH 18/19] Rename str-repeat to str-repeat.md --- .../terms/str-repeat/{str-repeat => str-repeat.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/php/concepts/string-functions/terms/str-repeat/{str-repeat => str-repeat.md} (100%) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat b/content/php/concepts/string-functions/terms/str-repeat/str-repeat.md similarity index 100% rename from content/php/concepts/string-functions/terms/str-repeat/str-repeat rename to content/php/concepts/string-functions/terms/str-repeat/str-repeat.md From 1def740cdd57c4276feefcdd2f60a2cd43985067 Mon Sep 17 00:00:00 2001 From: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> Date: Sat, 27 May 2023 11:36:51 -0400 Subject: [PATCH 19/19] prettier formatting --- .../php/concepts/string-functions/terms/str-repeat/str-repeat.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/php/concepts/string-functions/terms/str-repeat/str-repeat.md b/content/php/concepts/string-functions/terms/str-repeat/str-repeat.md index faf87cc78f5..b39cfd9877d 100644 --- a/content/php/concepts/string-functions/terms/str-repeat/str-repeat.md +++ b/content/php/concepts/string-functions/terms/str-repeat/str-repeat.md @@ -39,4 +39,3 @@ echo (str_repeat("I-don't-appear ",0). "\n"); ?> ``` -