STRREV(3) 1 STRREV(3)strrev - Reverse a stringSYNOPSIS
string strrev (string $string)
DESCRIPTION
Returns $string, reversed.
PARAMETERS
o $string
- The string to be reversed.
RETURN VALUES
Returns the reversed string.
EXAMPLES
Example #1
Reversing a string with strrev(3)
<?php
echo strrev("Hello world!"); // outputs "!dlrow olleH"
?>
PHP Documentation Group STRREV(3)
Check Out this Related Man Page
NL2BR(3) 1 NL2BR(3)nl2br - Inserts HTML line breaks before all newlines in a stringSYNOPSIS
string nl2br (string $string, [bool $is_xhtml = true])
DESCRIPTION
Returns $string with '<br />' or '<br>' inserted before all newlines (
,
,
and
).
PARAMETERS
o $string
- The input string.
o $is_xhtml
- Whether to use XHTML compatible line breaks or not.
RETURN VALUES
Returns the altered string.
EXAMPLES
Example #1
Using nl2br(3)
<?php
echo nl2br("foo isn't
bar");
?>
The above example will output:
foo isn't<br />
bar
Example #2
Generating valid HTML markup using the $is_xhtml parameter
<?php
echo nl2br("Welcome
This is my HTML document", false);
?>
The above example will output:
Welcome<br>
This is my HTML document
Example #3
Various newline separators
<?php
$string = "This
is
a
string
";
echo nl2br($string);
?>
The above example will output:
This<br />
is<br />
a<br />
string<br />
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | Added the optional $is_xhtml parameter. Before |
| | this version '<br />' was always inserted. |
| | |
+--------+---------------------------------------------------+
SEE ALSO htmlspecialchars(3), htmlentities(3), wordwrap(3), str_replace(3).
PHP Documentation Group NL2BR(3)
Consider the following code
#!\bib\bash
echo -n "Enter string : "
read str
l=`expr length "$str"`
while
do
echo -e `echo $str | cut -c"$l"`"\c"
l=`expr "$l" - 1`
done
echo
the above code works perfect for string with no space in between. but fails when there is a... (2 Replies)
Why when using realloc, john is reversed 3 times but not the other 2 names ? But if I use malloc, then the 3 names are reversed correctly ? (but then there is a memory leak)
How can I reverse all 3 names without a memory leak ?
char *BUFFER = NULL;
char *STRREVERSE(const char *STRING)
{... (5 Replies)
Hi all,
I jus wanna print string b after reversing it. but the out put is blank. My code snippet is below. :wall:
int main()
{
char * a, * b;
b = new char;
a = new char;
int len, le;
le = 0;
cout<< " enter your string \n";
cin>> a;
len = strlen(a);
for(int i =... (8 Replies)
hello all,
my question is not about How code can be rewritten, i just wanna know even though i am not using read only memory of C (i have declared str) why this function gives me segfault :wall:and the other code executes comfortably though both code uses same pointer arithmetic.
... (4 Replies)
Hello, I am trying to reverse complement one string and reverse another (NO complement!), both with pointer. My code compiled without error, but did not do the job I wanted.
#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
#include "kseq.h"
// STEP 1: declare the type of file... (5 Replies)
Hello,
I am basic level shell script developer. I have developed the following script. The shell script basically tracking various files containing certain strings. I am finding options to make the script run more faster. Any help/suggestion would be appreciated :)
#! /bin/bash
# Greps for... (6 Replies)