Sponsored Content
Top Forums Shell Programming and Scripting Smarter way to read $1 $2 in php Post 303033600 by Neo on Monday 8th of April 2019 11:18:11 PM
Old 04-09-2019
Oh. I forgot to mention, you can also try getopt() :

Code:
getopt ( string $options [, array $longopts [, int &$optind ]] ) : array

Ref:

PHP: getopt - Manual
This User Gave Thanks to Neo For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read Embedded Newline characters with read (builtin) in KSH93

Hi Guys, Happy New Year to you all! I have a requirement to read an embedded new-line using KSH's read builtin. Here is what I am trying to do: run_sql "select guestid, address, email from guest" | while read id addr email do ## Biz logic goes here done I can take care of any... (6 Replies)
Discussion started by: a_programmer
6 Replies

2. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

3. Shell Programming and Scripting

Help with Bash piped while-read and a read user input at the same time

Hi I am new to writing script and want to use a Bash Piped while-read and read from user input. if something happens on server.log then do while loop or if something happend on user input then do while loop. Pseudocode something like: tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Discussion started by: MyMorris
8 Replies

4. Shell Programming and Scripting

Smarter conditional script with Table

Hi, currently I have a script with conditional checking. But it's not flexible to use, because i must create a more conditional script if there are more keyword (see table) required. Question is: Can I create a more smarter script that will be more flexible? I appreciate any help anyone can give... (8 Replies)
Discussion started by: jazzyzha
8 Replies

5. Shell Programming and Scripting

[Bash] Read History function & Read Arrowkeys

Hi. How can I create a history function? (By "read" command or so) & How can I configure a read command so that the arrow keys are not displayed so funny? (^[[A) Thanks in advance. (4 Replies)
Discussion started by: sinnlosername
4 Replies

6. Shell Programming and Scripting

Php script read from $1

Hello, I am trying to inject data extracted via php-json to sql database but unable to run it in loop mode. It is working just for one data, then stops. If it's necessary, I can share the complete php file. test.php <?php include_once 'imdb.class.php'; //mysql config. $servername =... (4 Replies)
Discussion started by: baris35
4 Replies

7. Shell Programming and Scripting

How to tell php to read shell?

.... Solved.... .. .. Hello, I've read couples of similar threads to my question and I strongly believe that I am doing something wrong. What I'm trying to do is to process data with php. It reads data from shell script. Everything goes well but at the end it does not print what it reads... (0 Replies)
Discussion started by: baris35
0 Replies
TOKEN_GET_ALL(3)							 1							  TOKEN_GET_ALL(3)

token_get_all - Split given source into PHP tokens

SYNOPSIS
array token_get_all (string $source) DESCRIPTION
token_get_all(3) parses the given $source string into PHP language tokens using the Zend engine's lexical scanner. For a list of parser tokens, see "List of Parser Tokens", or use token_name(3) to translate a token value into its string representation. PARAMETERS
o $source - The PHP source to parse. RETURN VALUES
An array of token identifiers. Each individual token identifier is either a single character (i.e.: ;, ., >, !, etc...), or a three ele- ment array containing the token index in element 0, the string content of the original token in element 1 and the line number in element 2. EXAMPLES
Example #1 token_get_all(3) examples <?php $tokens = token_get_all('<?php echo; ?>'); /* => array( array(T_OPEN_TAG, '<?php'), array(T_ECHO, 'echo'), ';', array(T_CLOSE_TAG, '?>') ); */ /* Note in the following example that the string is parsed as T_INLINE_HTML rather than the otherwise expected T_COMMENT (T_ML_COMMENT in PHP <5). This is because no open/close tags were used in the "code" provided. This would be equivalent to putting a comment outside of <?php ?> tags in a normal file. */ $tokens = token_get_all('/* comment */'); // => array(array(T_INLINE_HTML, '/* comment */')); ?> CHANGELOG
+--------+----------------------------------------+ |Version | | | | | | | Description | | | | +--------+----------------------------------------+ | 5.2.2 | | | | | | | Line numbers are returned in element 2 | | | | +--------+----------------------------------------+ PHP Documentation Group TOKEN_GET_ALL(3)
All times are GMT -4. The time now is 08:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy