Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $countLeftBracket = substr_count($argv[1],'('); // подсчет открывающих скобок
- $countRightBracket = substr_count($argv[1],')'); // подсчет закрывающих скобок
- if ( $countLeftBracket == $countRightBracket){ // сравнение количества открывающих и закрывающих скобок
- echo "Yes, the same number of ) and (";
- }
- else{
- echo "No, different quantity of ) and (";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement