Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. $countLeftBracket = substr_count($argv[1],'('); // подсчет открывающих скобок
  4. $countRightBracket = substr_count($argv[1],')'); // подсчет закрывающих скобок
  5.  
  6. if ( $countLeftBracket == $countRightBracket){ // сравнение количества открывающих и закрывающих скобок
  7. echo "Yes, the same number of ) and (";
  8. }
  9. else{
  10. echo "No, different quantity of ) and (";
  11. }
  12.  
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement