Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated php.php line 20 str_replace to ver PHP 8.0 #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mhemanthkmr
Copy link
Contributor

Changes done and close the issue #279

@@ -17,7 +17,7 @@
$string = 'Awesome cheatsheets';

str_contains($string, 'cheat'); // Find if the string contains the specified string (PHP >= 8.0)
str_replace('Awesome', 'Bonjour', $string); // Replace all occurence
str_replace('Awesome', 'Bonjour', $string, $count); // Replace all occurence

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both forms are valid, but we should leave the two lines and say that the $count variable is used to contain the number of replacements made.

Copy link

@MrSuricate2 MrSuricate2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct code, but leaving the two versions seems more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants