Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP strrev — Reverse a string

<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>
Comment

how to reverse a string in php

#Text must be in double quotes in brackets

echo strrev("Text goes here");
Comment

Reverse String PHP

<?php

$a = “abcdeg”;

echo strrev($a);

?>
Comment

how to reverse a string in php

use strrev(); function
Comment

php reverse string

strrev("web learn smart");
Comment

php Write a program to reverse an array or string

<?php
// Iterative PHP program
// to reverse an array
 
/* Function to reverse
$arr from start to end*/
function rvereseArray(&$arr, $start,
                       $end)
{
    while ($start < $end)
    {
        $temp = $arr[$start];
        $arr[$start] = $arr[$end];
        $arr[$end] = $temp;
        $start++;
        $end--;
    }
}    
 
/* Utility function to
   print an array */
function printArray(&$arr, $size)
{
for ($i = 0; $i < $size; $i++)
echo $arr[$i] . " ";
 
echo "
";
}
 
// Driver code
$arr = array(1, 2, 3, 4, 5, 6);
 
// To print original array
printArray($arr, 6);
 
// Function calling
rvereseArray($arr, 0, 5);
 
echo "Reversed array is" ."
";
 
// To print the Reversed array
printArray($arr, 6);
 

?>
Comment

PREVIOUS NEXT
Code Example
Php :: php switch case statement 
Php :: how to use uuid in laravel model 
Php :: laravel sanctum instalation 
Php :: PHP temporary files 
Php :: php number multiple of 
Php :: laravel creat new model 
Php :: laravel phpunit not run test 
Php :: how change resource route parameters lravel 
Php :: laravel one to many relationship example 
Php :: drupal 8 entity_view 
Php :: add slashes to string 
Php :: add contact form 7 to page templat e 
Php :: specify php version composer 
Php :: laravel create custom route file 
Php :: php ErrorException Undefined variable inside array_map 
Php :: php order array 
Php :: Update page template and remove page editor in wordpress 
Php :: Toaster switch Statement 
Php :: Skip model mutator 
Php :: Laravel Nested whenLoaded 
Php :: get last word of string php 
Php :: php if cart is not empty 
Php :: check mobile number length in php 
Php :: get product price by id woocommerce snippet 
Php :: string to array php 
Php :: php serve a video (THE ONLY WORKING CODE) 
Php :: How to check if a session is expired or never was set in php 
Php :: link title to blog post wordpress in the loop 
Php :: Laravel unique with Validation rule 
Php :: update php 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =