Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to traverse characters in a string in a for loop in php

<?php
$str = "apple";
 
$length = strlen($str);
for ($index = 0; $index < $length; $index++) {
    echo $str[$index];
    echo "<br>";
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: wp get post content by id 
Php :: date casting from datetime to d-m-Y laravel using cast 
Php :: use app name in laravel blade 
Php :: disable wordpress admin bar 
Php :: how to create cookie in php 
Php :: wordpress get taxonomy of a post 
Php :: wpml get translated post id 
Php :: get theme path in wordpress 
Php :: background image in laravel blade 
Php :: php check if url exists 
Php :: how to get previous page name in php 
Php :: order alphabetically wp php 
Php :: wp get all post categories 
Php :: wp custom rest endpoint 
Php :: sleep microseconds php 
Php :: php date loop 
Php :: get last 30 days records in laravel 
Php :: auth pages not getting css in laravel 
Php :: uninstall php 8.0 ubuntu 
Php :: install phpmyadmin ubuntu 
Php :: why use ob_start() in php 
Php :: node dockerfile 
Php :: wordpress user enumeration 
Php :: php json_encode encode not escape forward slash 
Php :: string to double php 
Php :: php echo alert js 
Php :: wordpress logout to home page 
Php :: Get PHP Date Time Difference in Days, Hours, Minutes, and Seconds 
Php :: php array to console 
Php :: usleep php 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =