Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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 :: mysql php update sum same table 
Php :: PHP utf8_decode — Converts a string from UTF-8 to ISO-8859-1, replacing invalid or unrepresentable characters 
Php :: WP Hero Img 
Php :: ubuntu PHP Installation broken - shows strange php code as response 
Php :: featured image tab not displayed on post 
Php :: wordpress add_action echo on edit page 
Php :: enhanced ecommerce data layer for woocommerce 
Php :: how to remove payment link in invoice woocommerce 
Php :: static functions php 
Php :: phpdoc array of strings 
Php :: livewire mount return type 
Php :: wc php coupon applied message still after coupon delete 
Php :: how to get textbox value in php without submit 
Php :: Criando shortcode no Wordpress 
Php :: no cache on browser back php 
Php :: send emails with runtime configurations in laravelk 
Php :: source code in html to add two numbers together 
Php :: $order- date 
Php :: PHP quoted_printable_decode — Convert a quoted-printable string to an 8 bit string 
Php :: php pdo check if record exists before insert 
Php :: laravel eloquent where value less then 5 and greter then 0 
Php :: customly add reviews from code site reviews wp 
Php :: install tinymce php 
Php :: https://www.codegrepper.com/documentation.php 
Php :: php vender 403 forbidden 
Php :: forPage return keys on page 2 
Php :: woocommerce create client account without email 
Php :: laravel , How can I increment and decrement value with unique id 
Php :: laravel title dynamic 
Php :: phpunit-watcher 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =