echo

Are there any length limits on PHP echo?

Hi, I have this script that fetches some data from mysql and then uses echo to output it. But, as the page have grown and gotten longer all of a sudden i have this weird behavior where it cuts of the end at 65535 chrs (when using strlen to check) The data is all saved in MySQL, beyond the 65535 chrs showing when using echo. EDIT: Sorry,...

Best way to echo HTML in PHP

I'm a fairly experienced PHP coder, and am just wondering what the best way of echoing large chunks of HTML code is (best practise). Is it better to do this: <?php echo "<head> <title>title</title> <style></style> </head>"; ?> or this: <?php define("rn","\r\n"); echo "<head>".rn ."<title>title</title>".rn ."<style></style".rn ."</he...

Open-source echo server

Does anyone know any open-source echo server? I know I could write one by myself, but I'd like something more fancy with ability to listen on certain port(s), send keep-alives etc. so developing this myself would take likely hours. ...

How to echo an echo in php?

Hello, I have some basic PHP code: $raceramps56["short"] = "My Test Product"; $leftMenu = '<div class="leftMenuProductButton"><?PHP echo $raceramps56["short"] ?></div>'; Won't echo the PHP code, only the element. I've tried things like <div class="leftMenuProductButton">' . <?PHP echo $raceramps56["short"] ?>. '</div>'; Which ...

Issue with echo and tab in Bash

Hey, I would like to know if its possible to do formatting using echo in shell scripting. Here is a small code snippet which is giving me the problem echo -en "\rFileName : $filename : $index of $lines Completed" The Filename's is a string with varying length and this is causing problem with formating in the terminal. How ...

echo/print issue in php while loop

I need a fix for this.here is just part of my code <?php $number = 30; while($number > 0) { $number--; sleep(30); print "$number . Posted<br>"; } ?> The loop process in the loop is actually much bigger, i just put the important stuff. Anyways as you can see it should print 30 posted (wait 30 seconds) 29 Posted (wait 30 seconds...

echoing our parts of an Array?

I have the following array that I get as an output from facebook: http://www.paste.to/v/1jntlnml With the following code: $stream = $facebook->api_client->stream_get('',128342905144,'0','0',30,'','','',''); foreach($stream as $wallpost) { echo '<pre>'; print_r($wallpost); echo '</pre>'; } So I get the data that I need...

Escaping 'echo' in batch files

Iditically simple I hope ... I'm trying to create a bash command file on the fly from within an W7 DOS shell: :: inside the .BAT file .. :: check we are in the right directory echo pwd > command.txt :: get the shell to echo its environment variables :: !!!! How do I get around this ... ? echo echo $PWD I thought prefixing the second ...

$a ? $b : echo $c not work but $a ? $b : print $c works in PHP

//In PHP, $a ? $b : echo $c //does not work but $a ? $b : print $c //works Is there a reason for this? BTW,is not a keyword in PHP? ...

Formatting with echo command

The actual situation is a bit complicated, but the issue I'm running into is that I have an echo command within an eval command. Like so: $ eval echo 'keep my spacing' keep my spacing $ echo 'keep my spacing' keep my spacing I was wondering how I could keep eval from stripping my spacing so that the first command pri...

Function within echo problem

Hi, I have a slight problem with the echo statement outputting wrongly. Forexample when i do echo "<div id=\"twitarea\">" . fetchtwitter($rss) . "</div>"; it displays function output but OUTSIDE of twitarea div. What is the cause of this behavior perhaps syntax? thanks in advance Here is the actual function require_once('includes...

UNIX, get environment variable

Hi SO I have a ridiculous question due to a ridiculous problem. Normally if I want to get the contents of an environment variable in UNIX shell, I can do echo ${VAR} Let's assume, due to my ridiculous situation, that this isn't possible. How do I get the contents of an environment variable to stdout, without someone who is lookin...

php echo doesnt print newlines

Hey ! I started doing a new project in PHP / MySql . The Aim of this project is to manage articles for a magazine that i am the editor of. So the content of the articles, i decided i would store with the "TEXT" column type of MySql Now when i retrieve this column and print it with echo, the newlines are not there. Its all on the sam...

echo is not working in my php-gdlibrary page

Hi, i am trying to create an ellipse using php gd library; also i want to display something under the ellipse. but the usual echo will not work with this. somebody please help me to find the reason and suggest a solution. this is my php code header('Content-type: image/png'); $handle = imagecreate(100, 100); $background = imagecoloral...

PHP Echo A "/" Forwardslash?

I'm very surprised I couldn't find this question here, which makes me very sure it is here and I just didn't see it. Regardless, I'll ask again. How do I echo a forwardslash "/"? echo <?php echo $_SERVER['HTTP_HOST'] ?> . '/directory/'; Thanks -J ...

echo problem in audio/video chat application

I am making an audio/video chat application, i am using Flex, Flash Media Server 3.5, Flash Player 10, and I am facing the problem of echo very frequently. I am using a headset for audio recording. ...

How do you echo a string with every char in PHP?

I need to know if there's a way in PHP to echo a string with every char. For instance /n and the likes. Edit for clarification: When I have a webform and I submit it and I have this text: I am stupid and I cannot explain myself The text would be like this: I am stupid /n and I cannot /n explain myself If I use: nl2br I g...

Batch scripting for directories or better method

Hi Everyone, Looking at creating a simple batch file for my app. My app needs some directories to be in place as it runs. The first method I thought was just make a batch script: @ECHO OFF IF NOT EXIST C:\App GOTO :CREATE ELSE GOTO :DONTCREATE :CREATE MKDIR C:\App\Code ECHO DIRECTORY CREATED :DONTCREATE ECHO IT WAS ALREADY THERE 1...

echo newline suppression

Why $echo '-n' doesn't write -n on terminal although -n is written within quotes ? ...

'echo' or drop out of 'programming' write HTML then start PHP code again

For the most part, when I want to display some HTML code to be actually rendered I would use a 'close PHP' tag, write the HTML, then open the PHP again. eg <?php // some php code ?> <p>HTML that I want displayed</p> <?php // more php code ?> But I have seen lots of people who would just use echo instead, so they would have done the ab...