As an alternative to substr()
you could also use strpos()
$str="Personal-imiY2cdnpL01EzbZWr2YWzukkJmC3K6BMQpZU2wgfsOehCruDr";
if (strpos($str, 'Personal') === 0) {
// do stuff
}
More Related Contents:
- Php – Delimiter must not be alphanumeric or backslash [duplicate]
- Is it possible to get friend’s emails using facebook api?
- How do I make a request using HTTP basic authentication with PHP curl?
- Use PHP to create, edit and delete crontab jobs?
- String to byte array in php
- PHP session without cookies
- Send value of submit button when form gets posted
- How do I turn off PHP Notices?
- How to get URL of current page in PHP [duplicate]
- How to strip a tag and all of its inner html using the tag’s id?
- How to successfully rewrite old mysql-php code with deprecated mysql_* functions?
- Symfony2 conceptual issue: general bundles vs. specific ones
- PHP Configuration: It is not safe to rely on the system’s timezone settings [duplicate]
- Executing multiple SQL queries in one statement with PHP
- PHP form send email to multiple recipients
- How to connect to mssql using pdo through PHP and Linux?
- Use Javascript to access a variable passed through Twig
- mysql_num_rows() expects parameter 1 to be resource, boolean given in [duplicate]
- Sorting multidim array: prioritize if column contains substring, then order by a second column
- How to handle double quotes in string before XPath evaluation?
- How to set session timeout in Laravel?
- store_result() and get_result() in mysql returns false
- ffmpeg Progress Bar – Encoding Percentage in PHP
- How to parse a date string in PHP?
- How to separate letters and digits from a string in php
- utf8_(en|de)code removed from php7?
- PHP date time greater than today
- Copy file from remote server or URL [duplicate]
- PHP: How to check if a date is today, yesterday or tomorrow
- What encryption algorithm is best for encrypting cookies?