This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $var = 8; | |
| // Inline variable parsing | |
| echo "I'd like {$var} mangoes"; // = "I'd like 8 mangoes | |
| // String concatenation | |
| echo "I'd like ".$var." mangoes"; // I'd like 8 mangoes | |
| // Explicit cast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <h4>Browser Information</h4> | |
| <?php | |
| $browser=""; | |
| if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("MSIE"))) | |
| { | |
| $browser="Internet Explorer"; | |
| } | |
| else if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("CHROME"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $text = 'How are you?'; | |
| if (strpos($text, 'are') !== false) { | |
| echo 'true'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <php | |
| function is_our_student($students, $stringtocheck) | |
| { | |
| foreach ($students as $name) { | |
| if (stripos($stringtocheck, $name) !== FALSE) { | |
| return true; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $students = array("Rahul, Salim, Aftab, Shahnawaz, Faizal, Sameer"); | |
| $stringtocheck = "Aftab"; | |
| if(is_our_student($students, $stringtocheck)) { | |
| echo "It is our student."; | |
| } else { | |
| echo "Uknown child and he/she is not our student."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $students = array("Rahul, Salim, Aftab, Shahnawaz, Faizal, Sameer"); | |
| $stringtocheck = "Aftab"; | |
| if(is_our_student($students, $stringtocheck)) { | |
| echo "It is our student."; | |
| } else { | |
| echo "Uknown child and he/she is not our student."; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Lets get the page slug | |
| global $post; | |
| $post_slug=$post->post_name; | |
| // For display the data we need to echo it | |
| echo $post_slug; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // get page slug name | |
| $slug = get_post_field( 'post_name'); | |
| // echo the $slug | |
| echo $slug; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Your warranty is now void. | |
| * | |
| * I am not responsible for bricked devices, or dead SD cards, | |
| * nuclear war, penguin invasions or that you are getting fired because the alarm app failed. | |
| * before flashing it! YOU are choosing to make these modifications, and | |
| * If you point your finger at me for messing up your device, I will laugh at you. Hard | |
| * If you dont like this rom, Stay away from this thread! | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $students = "Kavin, Arbaz, Salim, Neha, Nisha"; | |
| $separate = explode(',', $students); | |
| print_r($students); |