Jump to content

Simulating ALT+Enter in PHP codes or in HTML or in Javascript


sherbetlemon

Recommended Posts

guys,, how can I simulate ALT+Enter in PHP?? I have this script which exports data to excel using namespace I have data which contain long texts and some formatting in them.. whenever the generation of excel file encounters <br/> or <p> it moves from the current cell to the next cell,, is there a way to prevent it from moving to the next cell???

 

Any help will be highly appreciated!!! Thanks in advance!! :)

Link to comment
Share on other sites

I don't have a windows machine to test it on, but you will probably have to escape the newline characters in the CSV that don't denote a new row of cells...

 

"line 1", "data 1", "this is a \\ndescription\\non multiple lines"
"line 2", .........

 

\n didb't work,, same with chr(10) or chr(13)

Link to comment
Share on other sites

PHP runs server-side, I'm not real sure what exactly it is your trying to do.

 

hmmm,, i'm generating excel files using php and namespace, it moves from the current cell to the next cell everytime the scripts encounter

<br/>, <div>,<p>

in the data which should not be the case.. is there a way to not make it move to the next cell,, I guess what i'm trying to say is that how can i do line break in a cell???

Link to comment
Share on other sites

I'm sorry, but I don't use Excel, so I have NO idea what you're talking about.  You could try removing the tags from the data or using htmlspecialchars on it. o-O

 

Thanks DarkWater.. actually, I've already done that.. but they want to retain all the html formatting on the cell,, they want the data to look exactly as it is on the web page... :'(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.