check if letter is in string php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}<?php
function g($string,$start,$end){
preg_match_all('/' . preg_quote($start, '/') . '(.*?)'. preg_quote($end, '/').'/i', $string, $m);
$out = array();
foreach($m[1] as $key => $value){
$type = explode('::',$value);
if(sizeof($type)>1){
if(!is_array($out[$type[0]]))
$out[$type[0]] = array();
$out[$type[0]][] = $type[1];
} else {
$out[] = $value;
}
}
return $out;
}
print_r(g('Sample text, [/text to extract/] Rest of sample text [/WEB::http://google.com/] bla bla bla. ','[/','/]'));
?>
results:
Array
(
[0] => text to extract
[WEB] => Array
(
[0] => http://google.com
)
)
Can be helpfull to custom parsing :)
Also in PHP:
- artisan migrate
- add custom helper laravel
- character lenght php
- array length php
- check chartercount in php
- base 64 encode decode not same php
- encode and decode int to base64 using php
- < Php echo date("m") . " "; ?> what is the output of this script?
- buddy group hide notice join
- best way to redirect with php
- FORMATA DATA COM PHP
- cache clear in cpde php laravel
- Undefined variable: subcopy laravel mail
- disable timestamp laravel
- filter array in php with passing extra params
- composer what to do get created laravel new project
- date in php in dats
- client's ip address in php
- array_combine function in php
- check if a text include a word php
- cusatom time format to timestamp php
- cache laravel example
- Impossible de trouver le paquet php-gettext
- check if value contain letter php