echo

problem with bash echo function

how do i print using echo in bash so the row wont "jump" abit to the right cause of the length of the Variable can u please help me with a command that do so ...

PHP echoing HTML code with more PHP included

I have blocks of HTML code in a MySQL database and my framework needs to print these within a PHP template which will be outputted to the browser. To do so I make this call: </tr> <!-- Section 3 --> <?php echo SIN_SiteView::get('section3') ?> <tr> Which gets the code either from the APC or MySQL, now the code it obtains looks ...

Bizarre php shell script behavior

It may help if you are on a Mac and use TextMate, though not entirely necessary. My php location: $which php /opt/local/bin/php The script: #!/opt/local/bin/php <?php shell_exec("echo -n 'my-string' > out.txt"); ?> The -n to echo suppress the newline that is automatically added to all shell echo commands. If I run the ab...

Differences between echo, echo(), print and print() in PHP

Possible Duplicates: How are echo and print different in PHP? Is there any difference between print and echo in PHP? Whats the difference of echo,print,print_r in PHP? There are several ways to print output in PHP; including but not limited to: echo 'Hello'; echo ('Hello'); print 'Hello'; print ('Hello'); Are there any ...

How can I add html to this page??

I need to add html to this page without echoing it. I only want to display it if there is a session id. <?php session_start(); //home.php if($_SESSION['id']) { echo "Welcome ,".$_SESSION['username'] ; echo "<br /><br /><a href='/login/logout.php'>Logout</a>" ; echo "<br /><br /><a href='edit.php'>Edit Profile</a>" ; echo "<br /><br /><...

PHP - Looking at the Web Link

Hello everyone, I am very curious on how to do this. I want a PHP script to look at the string after the URL link and echo the value. For example, if I entered: "http://mywebsite.com/script.php?=43892" the script will echo the value 43892. I have seen this in most websites, and I think it will be a very useful to have in my applica...

displaying words from db as links in php

i have words like 123.com , 234.org in database how to display them as links? <?php $con=mysql_connect("localhost","root","123"); mysql_select_db("www",$con); $result=mysql_query("SELECT * FROM Tag"); for ($c=0; $c< mysql_num_rows($result); $c++) { $f=mysql_fetch_array($result); ###########echo $f['name']." "; } mysql_close($con); ?...

PHP why is echo faster than print

In PHP, why is echo faster than print They do the same thing... Why is one faster than the other? Do they do exactly the same thing??? ...

In PHP, why wasn't echo implemented as a function? (not echo vs. printf)

I'm just curious. In PHP, why wasn't echo implemented as a function? Why didn't PHP just give us printf and never tell about echo? Please note that: This is not a question about echo vs. printf. I already knew that echo is a language construct. UPDATE: By the way, was printf implemented using echo? ...

shorten echo in php 5.3 with Closures

I really liked PHPs <?= $out ?> to echo something. In PHP 5.3 this is deprecated as we know. So i thought about using something like that: $_ = function($name) use ($tpl_vars) { echo $tpl_vars[$name]; } In $tpl_vars all my template variables are stored. Now i can use <?php $_['name']; ?> instead of: <?php echo $tpl_vars['name']...

Unicode string php

Hi there ! I have a question! I want to print an unicode string in php (like 'سلام')! but when I use echo only some ??? apear!!! what whould I do??? This happens hen I want to cho string that retrieved from database! echo 'سلام'; result is: ???? I tried using header function but that didn't help me! ...

echo breaking on cyrillic symbol

i want to echo $html variable (which contents html code of page) to browser in my php script. but if my $html has cyrillic symbol echo is breaking on it symbol - all before this symbol is on page - but all next is empty, what reason can it be? ...

what is wrong with this php echo statement?

sorry i know this is a basic question, but i have been trying for hours and i cnt seem to think what is wrong with this! echo '<tr><td><img src="images/$row['picture']" alt="' . $row['username'] . '" /></td>'; is thier a more cleaner way to do this and and error free. thanks ...

PHP to search within txt file and echo the whole line

Hi there, Thank you for taking the time to read this and I will appreciate every single response no mater the quality of content. :) Using php, I'm trying to create a script which will search within a text file and grab that entire line and echo it. I have a text file (.txt) titled "numorder.txt" and within that text file, there are s...

How can I display something during the execution of a SQL script on SQLServer?

For example. I have a database upgrade script for adding a column to a database table. It looks a little like this: IF NOT Exists(SELECT * FROM SysColumns sc, SysObjects so WHERE sc.Name = 'dealer_number' AND so.Name = 'collector' AND so.Type= 'U' AND so.id = sc.id) BEGIN -- SQ...

PHP string concatenation problem?

function formatUpdate($tweet,$dt,$picture,$username) { if(is_string($dt)) $dt=strtotime($dt); $tweet=htmlspecialchars(stripslashes($tweet)); $at = "@" . $username; return' <li> <a href="nano.com/' . $username . '"><img class="avatar" src="images/' . $picture . '" width="48" height="48" alt="avatar" /></a...

Why does this code produce "syntax error, unexpected '='" ?

$text . = '1 paragraph'; $text . = '2 paragraph'; $text . = '3 paragraph'; echo $text; This code gives error syntax error, unexpected '='. What is the problem? ...

return output with php oop mysqli

Hello all i try to select stuff from the database and when i will return it so i can echo stuff out like $instance->titel $instance->content and like that, hope you understand, now i only got the id "1" echo out. here is my code <?php /** * Simon testClass */ class testClass { public $mysqli; public function __construct(...

PHP echo does not work.

I am trying to print a variable between curly braces as Product_number{product_version} I tried echo "$product_number{$product_version}"; But that does not work. I don't understand why :( ...

Interview Question: Can we have an echo before header ?

I appeared for php test, their I was asked one question for which I could not find the answer. The question is like this. echo "MESSI is injured!!"; header("Location:somepage.php"); Interviewer want both header and echo to be written on the same page. I wonder how's it possible.It should give some error like headers already sent by...