473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to separate a long string to short string with space each 5 character in php?

7
I have a long string in db

$code = "ACTGTCTACTGGTCTAGCTAGTCATGCTAGTAATCG"
How to separate a long string to short string with space each 5 character?
Example:

ACTGT CTACT GGTCT AGCTA GTCAT GCTAG TAATC
Please help me, i am a biology student! Thanks!
Dec 9 '09 #1

✓ answered by Dormilich

try chunk_split(). I was a Chemistry student.

2 2577
Dormilich
8,658 Expert Mod 8TB
try chunk_split(). I was a Chemistry student.
Dec 9 '09 #2
nhbach
7
Thank you in advanced.
And, if i want to numbered the character in string when I use wordwap to break line this string, what I can do?

Example:
$str1 = "GCCGGCGGCCAGGGCGAGCGCTTGCTGGC"
$str2 = "GCCGG CGGCC AGGGC GAGCC TTGCT GGC" (i can do that now, thanks)

And:
1 GCCGG CGGCC
11 AGGGC GAGCC
21 TTGCT GGC

Please help me! Thanks
Dec 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: lawrence | last post by:
"Garp" <garp7@no7.blueyonder.co.uk> wrote in message news:<_vpuc.1424$j_3.13346038@news-text.cableinet.net>... > "lawrence" <lkrubner@geocities.com> wrote in message >...
2
by: Martin Körner | last post by:
Hi NG, I am using email module for creating mails with attachment (and then sending via smtplib). If the name of the attachment file is longer than about 60 characters the filename is wrapped...
7
by: Galina | last post by:
Hello I am going to copy a data from MS Access table into Oracle table. One of fields is memo type and data in this field range from 1 character to 551 long string. Do I need to create a field...
19
by: Philipp Lenssen | last post by:
I don't know the English word, but I'm referring to the double-dash which is used to separate parts of a sentence. I'm using — so far. Now I saw – which is slightly shorter. Some sites use --. ...
11
by: James Hu | last post by:
This program is long. I don't really want to bore everyone with the details, but it handles wierd cases like: /\ * this is a comment *\ / #define FOO ??/* this is not a comment */ char...
9
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
6
by: songie D | last post by:
If a size_t is cast to a long, and size_t is the length of a unicode string, does the resulting long need to be divided by sizeof(_TCHAR) in order to get the actual length in _TCHARs?
17
by: kevgibbo | last post by:
Hi, I'm currently having a problem where a long URL or a line of text with no spaces will break the design of a webpage, http:// blog.seoptimise.com/2007/01/how-to-add-delicious-and-digg-blog-...
7
by: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post by:
How do I split a title attribute value into lines within the source code so that the paragraph gets reassembled by the browser when it is being displayed? Microsoft Internet Explorer 7 preserves...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.