Return to strpbrk_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test strpbrk() function : basic functionality 3: --FILE-- 4: <?php 5: /* Prototype : array strpbrk(string haystack, string char_list) 6: * Description: Search a string for any of a set of characters 7: * Source code: ext/standard/string.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing strpbrk() : basic functionality ***\n"; 12: 13: // Initialise all required variables 14: $text = 'This is a Simple text.'; 15: var_dump( strpbrk($text, 'mi') ); 16: var_dump( strpbrk($text, 'ZS') ); 17: var_dump( strpbrk($text, 'Z') ); 18: var_dump( strpbrk($text, 'H') ); 19: 20: $text = ''; 21: var_dump( strpbrk($text, 'foo') ); 22: 23: $text = " aaa aaaSLR"; 24: var_dump( strpbrk($text, ' ') ); 25: 26: var_dump( strpbrk(5, 5) ); 27: var_dump( strpbrk(5, "5") ); 28: 29: ?> 30: ===DONE=== 31: --EXPECT-- 32: *** Testing strpbrk() : basic functionality *** 33: string(20) "is is a Simple text." 34: string(12) "Simple text." 35: bool(false) 36: bool(false) 37: bool(false) 38: string(12) " aaa aaaSLR" 39: string(1) "5" 40: string(1) "5" 41: ===DONE===