Search
 
SCRIPT & CODE EXAMPLE
 

PHP

palindrome in php

<?php

function palindrome($input) {
    $middle = strlen($input) / 2;
    $firstHalf = substr($input, 0, floor($middle));
    $secondHalf = substr($input, ceil($middle));
    return $firstHalf == strrev($secondHalf);
}

echo palindrome("racecar") ? "Palindrome" : "Not a palindrome";
Comment

PREVIOUS NEXT
Code Example
Php :: data XML 
Php :: php current url 
Php :: Comment définir un délimiteur de fil d’Ariane personnalisé dans WooCommerce 
Php :: Mixed int and string keys 
Php :: cookie phpsessid will be soon treated as cross-site cookie against 
Php :: undefined index / error reporting in php 
Php :: how to add php to html 
Php :: creating custom database 
Php :: menyimpan get di laravel 
Php :: laravel gigapay delete payout 
Php :: register style wordpress 
Php :: php bin/console debug events 
Php :: Drupal 8 / 9 entityTypeManager get multiple comments by cid 
Php :: https://stackoverflow.com/questions/34545641/php-artisan-makeauth-command-is-not-defined 
Php :: how to import Yomo in larave; 
Php :: wp php get product attribute name without pa 
Php :: php csv to multirow array $_FILES 
Php :: update query not working no errors found php mysql 
Php :: adding array not updating php 
Php :: how to cut middle part of text php 
Php :: Find template serving current page 
Php :: woo account page 
Php :: Right triangle start pattern of star 
Php :: typo3 add backend skin 
Php :: Comment créer automatiquement une méta description à partir de votre contenu dans WordPress 
Php :: 0.01 bnb to php 
Php :: orocrm switch dev mode 
Php :: larqavel migration 
Php :: escape class wordpress 
Php :: skäller västgötaspetsar 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =