Reply to Re: PHP Cli arguments

Your name:

Reply:


Posted by shimmyshack on 12/28/07 14:54

On Dec 28, 2:33 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote:
> The87Boy wrote:
> > I am trying to make a PHP Cli program, but there is something I do not
> > know what to do
>
> > If we take an example:
> > php5 test.php --add Hello World I am great --delete World great --sort
> > test.txt
>
> Why don't you escape the parameters?
>
> php5 test.php --add 'Hello World I am great' --delete 'World great' \
> --sort test.txt
>
> It's standard practice, and it will ease your life when iterating through
> $argv...
>
> Cheers,
> --
> ----------------------------------
> Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> Menos mal que la linea no da erržžžžžÍž...

yes excatly escape the commands using " or ' and then explode by
space (" ") once you have the commands as a string

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация