![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP – mb_ereg_search_init() function
The mb_ereg_search_init() function in PHP is used to setup string and regular expression pattern for a multibyte regular expression match. The values are used for mb_ereg_search_regs, mb_ereg_search_pos, and mb_ereg_search.
Syntax
bool mb_ereg_search_init( $str_string, $str_pattern=null, $str_options=null )
Parameters
mb_ereg_search_init() accepts three parameters −
string − This is the search string.
pattern − This is the search pattern.
options − This is the search option. .
Return Values
mb_ereg_search_init() returns True on success and False on failure.
Example
<?php // UTF-8 Encoding $encoding=mb_regex_encoding("UTF-8"); // String "PHP online tutorial" $bool = mb_ereg_search_init("PHP online tutorial", "[l]"); var_dump($bool); var_dump($encoding); ?>
Output
bool(true) bool(true)
Advertisements